@@ -205,64 +205,6 @@ describe('user send password reset email', () => {
205205 } )
206206 } )
207207 describe ( 'given an unsuccessful validation' , ( ) => {
208- describe ( 'userKey is undefined' , ( ) => {
209- it ( 'returns an error message' , async ( ) => {
210- const token = tokenize ( {
211- parameters : { userKey : 1 } ,
212- } )
213-
214- const response = await graphql (
215- schema ,
216- `
217- mutation {
218- verifyAccount(input: { verifyTokenString: "${ token } " }) {
219- result {
220- ... on VerifyAccountResult {
221- status
222- }
223- ... on VerifyAccountError {
224- code
225- description
226- }
227- }
228- }
229- }
230- ` ,
231- null ,
232- {
233- i18n,
234- request,
235- userKey : undefined ,
236- query,
237- auth : {
238- verifyToken : verifyToken ( { } ) ,
239- } ,
240- validators : {
241- cleanseInput,
242- } ,
243- loaders : {
244- loadUserByKey : loadUserByKey ( { query } ) ,
245- } ,
246- } ,
247- )
248-
249- const error = {
250- data : {
251- verifyAccount : {
252- result : {
253- code : 400 ,
254- description : 'Unable to verify account. Please try again.' ,
255- } ,
256- } ,
257- } ,
258- }
259-
260- expect ( response ) . toEqual ( error )
261- expect ( consoleOutput ) . toEqual ( [
262- `User attempted to verify their account, but the userKey is undefined.` ,
263- ] )
264- } )
265- } )
266208 describe ( 'user cannot be found in db' , ( ) => {
267209 it ( 'returns an error message' , async ( ) => {
268210 const token = tokenize ( {
@@ -308,7 +250,7 @@ describe('user send password reset email', () => {
308250 verifyAccount : {
309251 result : {
310252 code : 400 ,
311- description : 'Unable to verify account. Please try again .' ,
253+ description : 'Unable to verify account. Please request a new email .' ,
312254 } ,
313255 } ,
314256 } ,
@@ -391,7 +333,7 @@ describe('user send password reset email', () => {
391333
392334 expect ( response ) . toEqual ( error )
393335 expect ( consoleOutput ) . toEqual ( [
394- `When validating account user: ${ user . _key } attempted to verify account, but userKey is not located in the token parameters.` ,
336+ `When validating account, user attempted to verify account, but userKey is not located in the token parameters.` ,
395337 ] )
396338 } )
397339 } )
@@ -466,7 +408,7 @@ describe('user send password reset email', () => {
466408
467409 expect ( response ) . toEqual ( error )
468410 expect ( consoleOutput ) . toEqual ( [
469- `When validating account user: ${ user . _key } attempted to verify account, but userKey is not located in the token parameters.` ,
411+ `When validating account, user attempted to verify account, but userKey is not located in the token parameters.` ,
470412 ] )
471413 } )
472414 } )
@@ -541,7 +483,7 @@ describe('user send password reset email', () => {
541483
542484 expect ( response ) . toEqual ( error )
543485 expect ( consoleOutput ) . toEqual ( [
544- `User: ${ user . _key } attempted to verify their account, but the user id's do not match .` ,
486+ `User: 1 attempted to verify account, however no account is associated with this id .` ,
545487 ] )
546488 } )
547489 } )
@@ -769,64 +711,6 @@ describe('user send password reset email', () => {
769711 } )
770712 } )
771713 describe ( 'given an unsuccessful validation' , ( ) => {
772- describe ( 'userKey is undefined' , ( ) => {
773- it ( 'returns an error message' , async ( ) => {
774- const token = tokenize ( {
775- parameters : { userKey : 1 } ,
776- } )
777-
778- const response = await graphql (
779- schema ,
780- `
781- mutation {
782- verifyAccount(input: { verifyTokenString: "${ token } " }) {
783- result {
784- ... on VerifyAccountResult {
785- status
786- }
787- ... on VerifyAccountError {
788- code
789- description
790- }
791- }
792- }
793- }
794- ` ,
795- null ,
796- {
797- i18n,
798- request,
799- userKey : undefined ,
800- query,
801- auth : {
802- verifyToken : verifyToken ( { } ) ,
803- } ,
804- validators : {
805- cleanseInput,
806- } ,
807- loaders : {
808- loadUserByKey : loadUserByKey ( { query } ) ,
809- } ,
810- } ,
811- )
812-
813- const error = {
814- data : {
815- verifyAccount : {
816- result : {
817- code : 400 ,
818- description : 'todo' ,
819- } ,
820- } ,
821- } ,
822- }
823-
824- expect ( response ) . toEqual ( error )
825- expect ( consoleOutput ) . toEqual ( [
826- `User attempted to verify their account, but the userKey is undefined.` ,
827- ] )
828- } )
829- } )
830714 describe ( 'user cannot be found in db' , ( ) => {
831715 it ( 'returns an error message' , async ( ) => {
832716 const token = tokenize ( {
@@ -954,7 +838,7 @@ describe('user send password reset email', () => {
954838
955839 expect ( response ) . toEqual ( error )
956840 expect ( consoleOutput ) . toEqual ( [
957- `When validating account user: ${ user . _key } attempted to verify account, but userKey is not located in the token parameters.` ,
841+ `When validating account, user attempted to verify account, but userKey is not located in the token parameters.` ,
958842 ] )
959843 } )
960844 } )
@@ -1028,7 +912,7 @@ describe('user send password reset email', () => {
1028912
1029913 expect ( response ) . toEqual ( error )
1030914 expect ( consoleOutput ) . toEqual ( [
1031- `When validating account user: ${ user . _key } attempted to verify account, but userKey is not located in the token parameters.` ,
915+ `When validating account, user attempted to verify account, but userKey is not located in the token parameters.` ,
1032916 ] )
1033917 } )
1034918 } )
@@ -1102,7 +986,7 @@ describe('user send password reset email', () => {
1102986
1103987 expect ( response ) . toEqual ( error )
1104988 expect ( consoleOutput ) . toEqual ( [
1105- `User: ${ user . _key } attempted to verify their account, but the user id's do not match .` ,
989+ `User: 1 attempted to verify account, however no account is associated with this id .` ,
1106990 ] )
1107991 } )
1108992 } )
0 commit comments