@@ -10,6 +10,8 @@ describe('authController', () => {
10
10
let request ;
11
11
let response ;
12
12
13
+ const frontendURL = process . env . FRONTEND_URL ;
14
+
13
15
beforeAll ( async ( ) => {
14
16
request = supertest ( app ) ;
15
17
} ) ;
@@ -366,9 +368,7 @@ describe('authController', () => {
366
368
} ) ;
367
369
368
370
it ( 'triggers expected header' , ( ) => {
369
- expect ( response . header . location ) . toBe (
370
- 'http://localhost/frontend/login?messageKey=registerConfirmValidationError'
371
- ) ;
371
+ expect ( response . header . location ) . toBe ( `${ frontendURL } /login?messageKey=registerConfirmValidationError` ) ;
372
372
} ) ;
373
373
} ) ;
374
374
@@ -383,9 +383,7 @@ describe('authController', () => {
383
383
} ) ;
384
384
385
385
it ( 'triggers expected header' , ( ) => {
386
- expect ( response . header . location ) . toBe (
387
- 'http://localhost/frontend/login?messageKey=registerConfirmValidationError'
388
- ) ;
386
+ expect ( response . header . location ) . toBe ( `${ frontendURL } /login?messageKey=registerConfirmValidationError` ) ;
389
387
} ) ;
390
388
} ) ;
391
389
} ) ;
@@ -409,7 +407,7 @@ describe('authController', () => {
409
407
} ) ;
410
408
411
409
it ( 'triggers expected header' , ( ) => {
412
- expect ( response . header . location ) . toBe ( 'http://localhost/frontend/ login?messageKey=registerConfirmFailed' ) ;
410
+ expect ( response . header . location ) . toBe ( ` ${ frontendURL } / login?messageKey=registerConfirmFailed` ) ;
413
411
} ) ;
414
412
} ) ;
415
413
@@ -430,7 +428,7 @@ describe('authController', () => {
430
428
} ) ;
431
429
432
430
it ( 'triggers expected header' , ( ) => {
433
- expect ( response . header . location ) . toBe ( 'http://localhost/frontend/ login?messageKey=registerConfirmSuccess' ) ;
431
+ expect ( response . header . location ) . toBe ( ` ${ frontendURL } / login?messageKey=registerConfirmSuccess` ) ;
434
432
} ) ;
435
433
} ) ;
436
434
} ) ;
@@ -625,7 +623,7 @@ describe('authController', () => {
625
623
626
624
it ( 'triggers expected header' , ( ) => {
627
625
expect ( response . header . location ) . toBe (
628
- 'http://localhost/frontend/ password-reset-request?messageKey=passwordResetValidationError'
626
+ ` ${ frontendURL } / password-reset-request?messageKey=passwordResetValidationError`
629
627
) ;
630
628
} ) ;
631
629
} ) ;
@@ -641,7 +639,7 @@ describe('authController', () => {
641
639
642
640
it ( 'triggers expected header' , ( ) => {
643
641
expect ( response . header . location ) . toBe (
644
- 'http://localhost/frontend/ password-reset-request?messageKey=passwordResetValidationError'
642
+ ` ${ frontendURL } / password-reset-request?messageKey=passwordResetValidationError`
645
643
) ;
646
644
} ) ;
647
645
} ) ;
@@ -658,7 +656,7 @@ describe('authController', () => {
658
656
659
657
it ( 'triggers expected header' , ( ) => {
660
658
expect ( response . header . location ) . toBe (
661
- 'http://localhost/frontend/ password-reset-request?messageKey=passwordResetValidationError'
659
+ ` ${ frontendURL } / password-reset-request?messageKey=passwordResetValidationError`
662
660
) ;
663
661
} ) ;
664
662
} ) ;
@@ -680,7 +678,7 @@ describe('authController', () => {
680
678
681
679
it ( 'triggers expected header' , ( ) => {
682
680
expect ( response . header . location ) . toBe (
683
- `http://localhost/frontend /password-reset?messageKey=passwordResetTokenConfirmed&key=valid-key`
681
+ `${ frontendURL } /password-reset?messageKey=passwordResetTokenConfirmed&key=valid-key`
684
682
) ;
685
683
} ) ;
686
684
} ) ;
0 commit comments