@@ -33,9 +33,9 @@ const newHackerAccount0 = util.account.hackerAccounts.new[0];
33
33
const newHacker0 = util . hacker . newHacker0 ;
34
34
const invalidHackerAccount0 = util . account . hackerAccounts . invalid ;
35
35
const invalidHacker0 = util . hacker . invalidHacker0 ;
36
+ const invalidHacker1 = util . hacker . invalidHacker1 ;
36
37
const invalidHacker2 = util . hacker . invalidHacker2 ;
37
38
const invalidHacker3 = util . hacker . invalidHacker3 ;
38
- const invalidHacker4 = util . hacker . invalidHacker4 ;
39
39
const newHacker1 = util . hacker . newHacker1 ;
40
40
41
41
const noTeamHackerAccount0 = util . account . hackerAccounts . stored . noTeam [ 0 ] ;
@@ -53,7 +53,6 @@ const unconfirmedHackerAccount0 = util.hacker.unconfirmedAccountHacker0;
53
53
54
54
const unconfirmedHacker1 = util . hacker . unconfirmedAccountHacker1 ;
55
55
56
- const invalidHacker1 = util . hacker . invalidHacker1 ;
57
56
58
57
const BatchAcceptHackerArrayValid = [
59
58
util . hacker . TeamHacker0 . _id ,
@@ -114,9 +113,9 @@ describe("GET hacker", function() {
114
113
res . body . should . have . property ( "data" ) ;
115
114
116
115
let hacker = new Hacker ( TeamHacker0 ) ;
117
- chai . assert . equal (
118
- JSON . stringify ( res . body . data ) ,
119
- JSON . stringify ( hacker . toJSON ( ) )
116
+ chai . assert . deepStrictEqual (
117
+ res . body . data ,
118
+ JSON . parse ( JSON . stringify ( hacker ) ) ,
120
119
) ;
121
120
done ( ) ;
122
121
} ) ;
@@ -185,9 +184,9 @@ describe("GET hacker", function() {
185
184
res . body . should . have . property ( "data" ) ;
186
185
187
186
let hacker = new Hacker ( TeamHacker0 ) ;
188
- chai . assert . equal (
189
- JSON . stringify ( res . body . data ) ,
190
- JSON . stringify ( hacker . toJSON ( ) )
187
+ chai . assert . deepStrictEqual (
188
+ res . body . data ,
189
+ JSON . parse ( JSON . stringify ( hacker ) ) ,
191
190
) ;
192
191
193
192
done ( ) ;
@@ -221,9 +220,9 @@ describe("GET hacker", function() {
221
220
222
221
let hacker = new Hacker ( TeamHacker0 ) ;
223
222
224
- chai . assert . equal (
225
- JSON . stringify ( res . body . data ) ,
226
- JSON . stringify ( hacker . toJSON ( ) )
223
+ chai . assert . deepStrictEqual (
224
+ res . body . data ,
225
+ JSON . parse ( JSON . stringify ( hacker ) ) ,
227
226
) ;
228
227
229
228
done ( ) ;
@@ -311,9 +310,9 @@ describe("GET hacker", function() {
311
310
res . body . should . have . property ( "data" ) ;
312
311
313
312
let hacker = new Hacker ( TeamHacker0 ) ;
314
- chai . assert . equal (
315
- JSON . stringify ( res . body . data ) ,
316
- JSON . stringify ( hacker . toJSON ( ) )
313
+ chai . assert . deepStrictEqual (
314
+ res . body . data ,
315
+ JSON . parse ( JSON . stringify ( hacker ) )
317
316
) ;
318
317
319
318
done ( ) ;
@@ -347,9 +346,9 @@ describe("GET hacker", function() {
347
346
348
347
let hacker = new Hacker ( TeamHacker0 ) ;
349
348
350
- chai . assert . equal (
351
- JSON . stringify ( res . body . data ) ,
352
- JSON . stringify ( hacker . toJSON ( ) )
349
+ chai . assert . deepStrictEqual (
350
+ res . body . data ,
351
+ JSON . parse ( JSON . stringify ( hacker ) )
353
352
) ;
354
353
355
354
done ( ) ;
@@ -450,9 +449,9 @@ describe("POST create hacker", function() {
450
449
hacker . status = Constants . General . HACKER_STATUS_APPLIED ;
451
450
delete res . body . data . id ;
452
451
delete hacker . id ;
453
- chai . assert . equal (
454
- JSON . stringify ( res . body . data ) ,
455
- JSON . stringify ( hacker ) ,
452
+ chai . assert . deepStrictEqual (
453
+ res . body . data ,
454
+ JSON . parse ( JSON . stringify ( hacker ) ) ,
456
455
"objects do not match"
457
456
) ;
458
457
@@ -488,9 +487,9 @@ describe("POST create hacker", function() {
488
487
hacker . status = Constants . General . HACKER_STATUS_APPLIED ;
489
488
delete res . body . data . id ;
490
489
delete hacker . id ;
491
- chai . assert . equal (
492
- JSON . stringify ( res . body . data ) ,
493
- JSON . stringify ( hacker )
490
+ chai . assert . deepStrictEqual (
491
+ res . body . data ,
492
+ JSON . parse ( JSON . stringify ( hacker ) ) ,
494
493
) ;
495
494
done ( ) ;
496
495
} ) ;
@@ -547,39 +546,6 @@ describe("POST create hacker", function() {
547
546
) ;
548
547
} ) ;
549
548
550
- // should fail due to travel request larger than 100
551
- it ( "should FAIL if the new hacker inputs a value larger than 100 for travel reimbursement" , function ( done ) {
552
- util . auth . login ( agent , newHackerAccount0 , ( error ) => {
553
- if ( error ) {
554
- agent . close ( ) ;
555
- return done ( error ) ;
556
- }
557
- return agent
558
- . post ( `/api/hacker/` )
559
- . type ( "application/json" )
560
- . send ( invalidHacker2 )
561
- . end ( function ( err , res ) {
562
- res . should . have . status ( 422 ) ;
563
- res . should . be . json ;
564
- res . body . should . have . property ( "message" ) ;
565
- res . body . message . should . equal ( "Validation failed" ) ;
566
- res . body . should . have . property ( "data" ) ;
567
- res . body . data . should . have . property (
568
- "application.accommodation.travel"
569
- ) ;
570
- res . body . data [
571
- "application.accommodation.travel"
572
- ] . should . have . property ( "msg" ) ;
573
- res . body . data [
574
- "application.accommodation.travel"
575
- ] . msg . should . equal (
576
- "application.accommodation.travel must be between 0 and 100"
577
- ) ;
578
- done ( ) ;
579
- } ) ;
580
- } ) ;
581
- } ) ;
582
-
583
549
// should fail due to 'false' on code of conduct
584
550
it ( "should FAIL if the new hacker does not accept code of conduct" , function ( done ) {
585
551
util . auth . login ( agent , newHackerAccount0 , ( error ) => {
@@ -624,7 +590,7 @@ describe("POST create hacker", function() {
624
590
return agent
625
591
. post ( `/api/hacker/` )
626
592
. type ( "application/json" )
627
- . send ( invalidHacker3 )
593
+ . send ( invalidHacker2 )
628
594
. end ( function ( err , res ) {
629
595
res . should . have . status ( 422 ) ;
630
596
res . should . be . json ;
@@ -652,7 +618,7 @@ describe("POST create hacker", function() {
652
618
return agent
653
619
. post ( `/api/hacker/` )
654
620
. type ( "application/json" )
655
- . send ( invalidHacker4 )
621
+ . send ( invalidHacker3 )
656
622
. end ( function ( err , res ) {
657
623
res . should . have . status ( 422 ) ;
658
624
res . should . be . json ;
@@ -759,15 +725,15 @@ describe("POST create hacker", function() {
759
725
"application.general.jobInterest"
760
726
] . msg . should . equal ( "The value must be part of the enum" ) ;
761
727
res . body . data . should . have . property (
762
- "application.accommodation.travel"
728
+ "application.accommodation.travel.amount "
763
729
) ;
764
730
res . body . data [
765
- "application.accommodation.travel"
731
+ "application.accommodation.travel.amount "
766
732
] . should . have . property ( "msg" ) ;
767
733
res . body . data [
768
- "application.accommodation.travel"
734
+ "application.accommodation.travel.amount "
769
735
] . msg . should . equal (
770
- "application.accommodation.travel must be an integer."
736
+ "application.accommodation.travel.amount must be an integer."
771
737
) ;
772
738
res . body . data . should . have . property (
773
739
"application.accommodation.attendancePreference"
0 commit comments