Skip to content

Commit 853f3d9

Browse files
fix: update ranking question structure and validation in response creation tests
1 parent d1c0d8a commit 853f3d9

2 files changed

Lines changed: 112 additions & 45 deletions

File tree

scenarios/user-journey/form-lifecycle/04-question-management.http

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,11 @@ Content-Type: application/json
495495
"title": "Rank your work location preferences",
496496
"description": "Order the options based on your preference (most preferred first)",
497497
"order": 11,
498-
"sourceId": "{{singleChoiceQuestionId}}"
498+
"choices": [
499+
{ "name": "Remote" },
500+
{ "name": "On-site" },
501+
{ "name": "Hybrid" }
502+
]
499503
}
500504

501505
{{
@@ -509,13 +513,17 @@ Content-Type: application/json
509513
equal(data.id !== undefined, true, 'Question ID should exist');
510514
equal(data.type, 'RANKING', 'Type should be RANKING');
511515
equal(data.required, true, 'Required should be true');
512-
equal(data.sourceId, singleChoiceQuestionId, 'Source ID should match the single choice question');
516+
equal(data.choices.length, 3, 'Should have 3 choices');
517+
equal(data.choices[0].name, 'Remote', 'First choice should be Remote');
518+
equal(data.choices[1].name, 'On-site', 'Second choice should be On-site');
519+
equal(data.choices[2].name, 'Hybrid', 'Third choice should be Hybrid');
513520

514521
console.log('Created RANKING question:', data.id);
515522
});
516523

517524
const data = JSON.parse(response.body);
518525
exports.rankingQuestionId = data.id;
526+
exports.rankingOptions = data.choices;
519527
}}
520528

521529
###

0 commit comments

Comments
 (0)