Skip to content

Commit 6bbdb82

Browse files
Add metadata field to results_config response (#396)
* Add metadata field to results_config response * adjust tests * Remove internal types
1 parent 39751b6 commit 6bbdb82

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

spec/src/modules/quizzes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ describe(`ConstructorIO - Quizzes${bundledDescriptionSuffix}`, () => {
548548
expect(res).to.have.property('quiz_version_id').to.be.an('string');
549549
expect(res).to.have.property('quiz_id').to.be.an('string');
550550
expect(res).to.have.property('results_config').to.be.an('object');
551+
expect(res).to.have.property('metadata').to.be.an('object');
551552
});
552553
});
553554

@@ -564,6 +565,7 @@ describe(`ConstructorIO - Quizzes${bundledDescriptionSuffix}`, () => {
564565
const requestedUrlParams = helpers.extractUrlParamsFromFetch(fetchSpy);
565566

566567
expect(res).to.have.property('results_config').to.be.an('object');
568+
expect(res).to.have.property('metadata').to.be.an('object');
567569
expect(res).to.have.property('quiz_version_id').to.be.an('string').to.equal(quizVersionId);
568570
expect(res).to.have.property('quiz_id').to.be.an('string');
569571
expect(fetchSpy).to.have.been.called;

src/types/quizzes.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export interface BaseQuestion extends Record<string, any> {
123123
description: string;
124124
cta_text: Nullable<string>;
125125
images?: Nullable<QuestionImages>;
126+
is_skippable: Boolean;
126127
}
127128

128129
export interface FilterValueQuestion extends BaseQuestion {
@@ -188,6 +189,7 @@ export interface QuizResultsConfig extends Record<string, any> {
188189
}
189190

190191
export interface QuizResultsConfigResponse extends Record<string, any> {
192+
metadata: Nullable<object>,
191193
results_config: QuizResultsConfig,
192194
quiz_version_id: string;
193195
quiz_id: string;

0 commit comments

Comments
 (0)