@@ -23,9 +23,9 @@ describe("Custom Pages Configuration", () => {
23
23
} ,
24
24
publicServerURL : "https://my.public.server.com/1"
25
25
} ) ;
26
-
26
+
27
27
var config = new Config ( "test" ) ;
28
-
28
+
29
29
expect ( config . invalidLinkURL ) . toEqual ( "myInvalidLink" ) ;
30
30
expect ( config . verifyEmailSuccessURL ) . toEqual ( "myVerifyEmailSuccess" ) ;
31
31
expect ( config . choosePasswordURL ) . toEqual ( "myChoosePassword" ) ;
@@ -78,7 +78,7 @@ describe("Email Verification", () => {
78
78
}
79
79
} ) ;
80
80
} ) ;
81
-
81
+
82
82
it ( 'does not send verification email when verification is enabled and email is not set' , done => {
83
83
var emailAdapter = {
84
84
sendVerificationEmail : ( ) => Promise . resolve ( ) ,
@@ -119,7 +119,7 @@ describe("Email Verification", () => {
119
119
}
120
120
} ) ;
121
121
} ) ;
122
-
122
+
123
123
it ( 'does send a validation email when updating the email' , done => {
124
124
var emailAdapter = {
125
125
sendVerificationEmail : ( ) => Promise . resolve ( ) ,
@@ -169,7 +169,7 @@ describe("Email Verification", () => {
169
169
}
170
170
} ) ;
171
171
} ) ;
172
-
172
+
173
173
it ( 'does send with a simple adapter' , done => {
174
174
var calls = 0 ;
175
175
var emailAdapter = {
@@ -311,7 +311,7 @@ describe("Email Verification", () => {
311
311
followRedirect : false ,
312
312
} , ( error , response , body ) => {
313
313
expect ( response . statusCode ) . toEqual ( 302 ) ;
314
- expect ( response . body ) . toEqual ( 'Found. Redirecting to http://localhost:8378/1/apps/verify_email_success.html?username=zxcv ' ) ;
314
+ expect ( response . body ) . toEqual ( 'Found. Redirecting to http://localhost:8378/1/apps/verify_email_success.html?username=user%2Bworld ' ) ;
315
315
user . fetch ( )
316
316
. then ( ( ) => {
317
317
expect ( user . get ( 'emailVerified' ) ) . toEqual ( true ) ;
@@ -342,7 +342,7 @@ describe("Email Verification", () => {
342
342
publicServerURL : "http://localhost:8378/1"
343
343
} ) ;
344
344
user . setPassword ( "asdf" ) ;
345
- user . setUsername ( "zxcv " ) ;
345
+ user . setUsername ( "hello+world " ) ;
346
346
user . set ( 'email' , '[email protected] ' ) ;
347
347
user . signUp ( ) ;
348
348
} ) ;
@@ -453,7 +453,7 @@ describe("Email Verification", () => {
453
453
} ) ;
454
454
455
455
describe ( "Password Reset" , ( ) => {
456
-
456
+
457
457
it ( 'should send a password reset link' , done => {
458
458
var user = new Parse . User ( ) ;
459
459
var emailAdapter = {
@@ -503,7 +503,7 @@ describe("Password Reset", () => {
503
503
} ) ;
504
504
} ) ;
505
505
} ) ;
506
-
506
+
507
507
it ( 'redirects you to invalid link if you try to request password for a nonexistant users email' , done => {
508
508
setServerConfiguration ( {
509
509
serverURL : 'http://localhost:8378/1' ,
@@ -555,8 +555,8 @@ describe("Password Reset", () => {
555
555
return ;
556
556
}
557
557
var token = match [ 1 ] ;
558
-
559
- request . post ( {
558
+
559
+ request . post ( {
560
560
url : "http://localhost:8378/1/apps/test/request_password_reset" ,
561
561
body : `new_password=hello&token=${ token } &username=zxcv` ,
562
562
headers : {
@@ -571,15 +571,15 @@ describe("Password Reset", () => {
571
571
}
572
572
expect ( response . statusCode ) . toEqual ( 302 ) ;
573
573
expect ( response . body ) . toEqual ( 'Found. Redirecting to http://localhost:8378/1/apps/password_reset_success.html' ) ;
574
-
574
+
575
575
Parse . User . logIn ( "zxcv" , "hello" ) . then ( function ( user ) {
576
576
done ( ) ;
577
577
} , ( err ) => {
578
578
console . error ( err ) ;
579
579
fail ( "should login with new password" ) ;
580
580
done ( ) ;
581
581
} ) ;
582
-
582
+
583
583
} ) ;
584
584
} ) ;
585
585
} ,
@@ -613,6 +613,5 @@ describe("Password Reset", () => {
613
613
} ) ;
614
614
} ) ;
615
615
} ) ;
616
-
617
- } )
618
616
617
+ } )
0 commit comments