Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(profile): allow to reset phone number
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux authored and AndyScherzinger committed Mar 21, 2025
commit e1fe4f6e247b3e6f164a31af6506b7ffdde37059
4 changes: 4 additions & 0 deletions apps/settings/src/components/PersonalInfo/PhoneSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export default {

methods: {
onValidate(value) {
if (value === '') {
return true
}

if (defaultPhoneRegion) {
return isValidPhoneNumber(value, defaultPhoneRegion)
}
Expand Down
34 changes: 34 additions & 0 deletions cypress/e2e/settings/personal-info.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,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
Expand Down
Loading