@@ -35,11 +35,11 @@ describe('/exam-environment/', () => {
3535 await mock . seedEnvExam ( ) ;
3636 // Add exam environment authorization token
3737 const res = await superPost ( '/user/exam-environment/token' ) ;
38- expect ( res . status ) . toBe ( 200 ) ;
38+ expect ( res . status ) . toBe ( 201 ) ;
3939 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
4040 examEnvironmentAuthorizationToken =
4141 // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
42- res . body . data . examEnvironmentAuthorizationToken ;
42+ res . body . examEnvironmentAuthorizationToken ;
4343 } ) ;
4444
4545 describe ( 'POST /exam-environment/exam/attempt' , ( ) => {
@@ -389,11 +389,9 @@ describe('/exam-environment/', () => {
389389 expect ( res ) . toMatchObject ( {
390390 status : 200 ,
391391 body : {
392- data : {
393- examAttempt : {
394- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
395- id : expect . not . stringMatching ( mock . examAttempt . id )
396- }
392+ examAttempt : {
393+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
394+ id : expect . not . stringMatching ( mock . examAttempt . id )
397395 }
398396 }
399397 } ) ;
@@ -419,9 +417,7 @@ describe('/exam-environment/', () => {
419417 expect ( res ) . toMatchObject ( {
420418 status : 200 ,
421419 body : {
422- data : {
423- examAttempt : latestAttempt
424- }
420+ examAttempt : latestAttempt
425421 }
426422 } ) ;
427423 } ) ;
@@ -555,10 +551,8 @@ describe('/exam-environment/', () => {
555551 expect ( res ) . toMatchObject ( {
556552 status : 200 ,
557553 body : {
558- data : {
559- examAttempt,
560- exam : userExam
561- }
554+ examAttempt,
555+ exam : userExam
562556 }
563557 } ) ;
564558 } ) ;
@@ -644,15 +638,15 @@ describe('/exam-environment/', () => {
644638 } ) ;
645639 } ) ;
646640
647- describe ( 'POST /exam-environment/token/verify ' , ( ) => {
641+ describe ( 'GET /exam-environment/token-meta ' , ( ) => {
648642 it ( 'should allow a valid request' , async ( ) => {
649- const res = await superPost ( '/exam-environment/token/verify ' ) . set (
643+ const res = await superGet ( '/exam-environment/token-meta ' ) . set (
650644 'exam-environment-authorization-token' ,
651645 'invalid-token'
652646 ) ;
653647
654648 expect ( res ) . toMatchObject ( {
655- status : 200 ,
649+ status : 418 ,
656650 body : {
657651 code : 'FCC_EINVAL_EXAM_ENVIRONMENT_AUTHORIZATION_TOKEN'
658652 }
0 commit comments