@@ -62,7 +62,7 @@ describe(`ConstructorIO - Quizzes${bundledDescriptionSuffix}`, () => {
6262 expect ( res ) . to . have . property ( 'quiz_version_id' ) . to . be . an ( 'string' ) ;
6363 expect ( res ) . to . have . property ( 'questions' ) . to . be . an ( 'array' ) ;
6464 expect ( res . questions [ 0 ] . id ) . to . equal ( 1 ) ;
65- expect ( res . total_questions ) . to . equal ( 1 ) ;
65+ expect ( res . total_questions ) . to . equal ( 4 ) ;
6666 expect ( fetchSpy ) . to . have . been . called ;
6767 expect ( requestedUrlParams ) . to . have . property ( 'key' ) ;
6868 expect ( requestedUrlParams ) . to . have . property ( 'i' ) ;
@@ -103,7 +103,7 @@ describe(`ConstructorIO - Quizzes${bundledDescriptionSuffix}`, () => {
103103
104104 expect ( res ) . to . have . property ( 'questions' ) . to . be . an ( 'array' ) ;
105105 expect ( res ) . to . have . property ( 'quiz_version_id' ) . to . be . an ( 'string' ) . to . equal ( quizVersionId ) ;
106- expect ( res . total_questions ) . to . equal ( 1 ) ;
106+ expect ( res . total_questions ) . to . equal ( 4 ) ;
107107 expect ( fetchSpy ) . to . have . been . called ;
108108 expect ( requestedUrlParams ) . to . have . property ( 'quiz_version_id' ) . to . equal ( quizVersionId ) ;
109109 } ) ;
@@ -145,6 +145,18 @@ describe(`ConstructorIO - Quizzes${bundledDescriptionSuffix}`, () => {
145145
146146 return expect ( quizzes . getQuizAllQuestions ( validQuizId , { quizVersionId : 'foo' } ) ) . to . eventually . be . rejected ;
147147 } ) ;
148+
149+ it ( 'Should return 400 when quiz has jump logic' , ( ) => {
150+ const { quizzes } = new ConstructorIO ( {
151+ apiKey : quizApiKey ,
152+ fetch : fetchSpy ,
153+ } ) ;
154+
155+ return expect ( quizzes . getQuizAllQuestions ( 'test-quiz-2' ) ) . to . eventually . be . rejected . then ( ( err ) => {
156+ expect ( err . status ) . to . equal ( 400 ) ;
157+ expect ( err . message ) . to . equal ( 'The requested quiz does not support question retrieval.' ) ;
158+ } ) ;
159+ } ) ;
148160 } ) ;
149161
150162 describe ( 'getQuizNextQuestion' , ( ) => {
0 commit comments