diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2025-03-13 23:20:59 +0100 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2025-03-18 11:20:34 +0100 |
commit | b1eb296c844e23ccb7db17f164b67eb2c7278a16 (patch) | |
tree | 7680ad8385b2076be402edb30c7d92bfed34225f | |
parent | 0446b1b64adbbc8240733255add131ecb78998aa (diff) | |
download | nextcloud-server-backport/51477/stable30.tar.gz nextcloud-server-backport/51477/stable30.zip |
fix(profile): allow to reset phone numberbackport/51477/stable30
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
-rw-r--r-- | apps/settings/src/components/PersonalInfo/PhoneSection.vue | 4 | ||||
-rw-r--r-- | cypress/e2e/settings/personal-info.cy.ts | 34 |
2 files changed, 38 insertions, 0 deletions
diff --git a/apps/settings/src/components/PersonalInfo/PhoneSection.vue b/apps/settings/src/components/PersonalInfo/PhoneSection.vue index 13ac7fdca0f..8ddeada960e 100644 --- a/apps/settings/src/components/PersonalInfo/PhoneSection.vue +++ b/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) } diff --git a/cypress/e2e/settings/personal-info.cy.ts b/cypress/e2e/settings/personal-info.cy.ts index e4c4018873c..6e76b0e97d6 100644 --- a/cypress/e2e/settings/personal-info.cy.ts +++ b/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 |