Browse Source

Merge pull request #51510 from nextcloud/backport/51477/stable30

[stable30] fix(profile): allow to unset phone number
pull/51661/head
Andy Scherzinger 7 months ago
committed by GitHub
parent
commit
7628f5a4a2
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      apps/settings/src/components/PersonalInfo/PhoneSection.vue
  2. 34
      cypress/e2e/settings/personal-info.cy.ts
  3. 4
      dist/settings-vue-settings-personal-info.js
  4. 2
      dist/settings-vue-settings-personal-info.js.map

4
apps/settings/src/components/PersonalInfo/PhoneSection.vue

@ -39,6 +39,10 @@ export default {
methods: {
onValidate(value) {
if (value === '') {
return true
}
if (defaultPhoneRegion) {
return isValidPhoneNumber(value, defaultPhoneRegion)
}

34
cypress/e2e/settings/personal-info.cy.ts

@ -320,6 +320,40 @@ describe('Settings: Change personal information', { testIsolation: true }, () =>
cy.get('a[href="tel:+498972101099701"]').should('be.visible')
})
it('Can set phone number with phone region', () => {
cy.contains('label', 'Phone number').scrollIntoView()
inputForLabel('Phone number').type('{selectAll}0 40 428990')
inputForLabel('Phone number').should('have.attr', 'class').and('contain', '--error')
cy.runOccCommand('config:system:set default_phone_region --value DE')
cy.reload()
cy.contains('label', 'Phone number').scrollIntoView()
inputForLabel('Phone number').type('{selectAll}0 40 428990')
handlePasswordConfirmation(user.password)
cy.wait('@submitSetting')
cy.reload()
inputForLabel('Phone number').should('have.value', '+4940428990')
})
it('Can reset phone number', () => {
cy.contains('label', 'Phone number').scrollIntoView()
inputForLabel('Phone number').type('{selectAll}+49 40 428990')
handlePasswordConfirmation(user.password)
cy.wait('@submitSetting')
cy.reload()
inputForLabel('Phone number').should('have.value', '+4940428990')
inputForLabel('Phone number').clear()
handlePasswordConfirmation(user.password)
cy.wait('@submitSetting')
cy.reload()
inputForLabel('Phone number').should('have.value', '')
})
it('Can set Website and change its visibility', () => {
cy.contains('label', 'Website').scrollIntoView()
// Check invalid input

4
dist/settings-vue-settings-personal-info.js
File diff suppressed because it is too large
View File

2
dist/settings-vue-settings-personal-info.js.map
File diff suppressed because it is too large
View File

Loading…
Cancel
Save