Skip to content

Commit cc9c477

Browse files
change signup error from referencing Username to Email (canada-ca#2379)
* change signup error from referencing Username to Email There is no field the user can see called username, So they were not clearly told it was the email that was causing the issue. * update sign-up.test for new text
1 parent d0b6e85 commit cc9c477

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

api-js/src/locale/en/messages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@
501501
'User could not be queried.': 'User could not be queried.',
502502
'User role was updated successfully.':
503503
'User role was updated successfully.',
504-
'Username already in use.': 'Username already in use.',
504+
'Email already in use.': 'Email already in use.',
505505
'Username not available, please try another.':
506506
'Username not available, please try another.',
507507
'You must provide a `first` or `last` value to properly paginate the `DKIMResults` connection.':

api-js/src/locale/fr/messages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@
261261
'Unable to verify unknown organization.': 'todo',
262262
'User could not be queried.': 'todo',
263263
'User role was updated successfully.': 'todo',
264-
'Username already in use.': 'todo',
264+
'Email already in use.': 'todo',
265265
'Username not available, please try another.': 'todo',
266266
'You must provide a `first` or `last` value to properly paginate the `DKIMResults` connection.':
267267
'todo',

api-js/src/user/mutations/__tests__/sign-up.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ describe('testing user sign up', () => {
680680
])
681681
})
682682
})
683-
describe('when the user name already in use', () => {
683+
describe('when the user name (email) already in use', () => {
684684
beforeEach(async () => {
685685
await collections.users.save({
686686
userName: 'test.account@istio.actually.exists',
@@ -690,7 +690,7 @@ describe('testing user sign up', () => {
690690
emailValidated: false,
691691
})
692692
})
693-
it('returns a user name already in use error', async () => {
693+
it('returns an email already in use error', async () => {
694694
const response = await graphql(
695695
schema,
696696
`
@@ -752,15 +752,15 @@ describe('testing user sign up', () => {
752752
signUp: {
753753
result: {
754754
code: 400,
755-
description: 'Username already in use.',
755+
description: 'Email already in use.',
756756
},
757757
},
758758
},
759759
}
760760

761761
expect(response).toEqual(error)
762762
expect(consoleOutput).toEqual([
763-
'User: test.account@istio.actually.exists tried to sign up, however there is already an account in use with that username.',
763+
'User: test.account@istio.actually.exists tried to sign up, however there is already an account in use with that email.',
764764
])
765765
})
766766
})
@@ -1853,7 +1853,7 @@ describe('testing user sign up', () => {
18531853
])
18541854
})
18551855
})
1856-
describe('when the user name already in use', () => {
1856+
describe('when the user name (email) already in use', () => {
18571857
beforeEach(async () => {
18581858
await collections.users.save({
18591859
userName: 'test.account@istio.actually.exists',
@@ -1863,7 +1863,7 @@ describe('testing user sign up', () => {
18631863
emailValidated: false,
18641864
})
18651865
})
1866-
it('returns a user name already in use error', async () => {
1866+
it('returns an email already in use error', async () => {
18671867
const response = await graphql(
18681868
schema,
18691869
`
@@ -1933,7 +1933,7 @@ describe('testing user sign up', () => {
19331933

19341934
expect(response).toEqual(error)
19351935
expect(consoleOutput).toEqual([
1936-
'User: test.account@istio.actually.exists tried to sign up, however there is already an account in use with that username.',
1936+
'User: test.account@istio.actually.exists tried to sign up, however there is already an account in use with that email.',
19371937
])
19381938
})
19391939
})

api-js/src/user/mutations/sign-up.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ export const signUp = new mutationWithClientMutationId({
9797

9898
if (typeof checkUser !== 'undefined') {
9999
console.warn(
100-
`User: ${userName} tried to sign up, however there is already an account in use with that username.`,
100+
`User: ${userName} tried to sign up, however there is already an account in use with that email.`,
101101
)
102102
return {
103103
_type: 'error',
104104
code: 400,
105-
description: i18n._(t`Username already in use.`),
105+
description: i18n._(t`Email already in use.`),
106106
}
107107
}
108108

0 commit comments

Comments
 (0)