Upgrade dynamic questions to authored parity
This commit is contained in:
@@ -140,6 +140,29 @@ test("public API and disposable learner journey", async () => {
|
||||
await call("/api/dashboard", { token });
|
||||
await call("/api/ratings/me", { token });
|
||||
|
||||
const { data: dynamicStatus } = await call("/api/dynamic-questions/status", { token });
|
||||
expect(dynamicStatus.available).toBe(true);
|
||||
expect(dynamicStatus.publishedObjectives).toBe(5);
|
||||
const { data: dynamicQuestion } = await call("/api/dynamic-questions/next", {
|
||||
method: "POST", token, body: { runToken: "" }
|
||||
});
|
||||
expect(dynamicQuestion.generationToken).toBeTruthy();
|
||||
expect(dynamicQuestion.runToken).toBeTruthy();
|
||||
expect(dynamicQuestion.question.stem.length).toBeGreaterThan(220);
|
||||
expect(dynamicQuestion.question.choices).toHaveLength(5);
|
||||
expect(Object.keys(dynamicQuestion.question.choiceExplanations)).toHaveLength(5);
|
||||
expect(dynamicQuestion.question.reviewFollowups.length).toBeGreaterThan(0);
|
||||
const dynamicChoice = dynamicQuestion.question.choices[0].id;
|
||||
const { data: dynamicAttempt } = await call("/api/dynamic-questions/attempt", {
|
||||
method: "POST", token, body: {
|
||||
generationToken: dynamicQuestion.generationToken,
|
||||
choiceId: dynamicChoice,
|
||||
isSkip: false,
|
||||
durationSeconds: 5
|
||||
}
|
||||
});
|
||||
expect(dynamicAttempt.objectiveId).toBeTruthy();
|
||||
|
||||
const { data: queue } = await call("/api/review-queue/next", {
|
||||
method: "POST", token, body: { excludeExternalIds: [], supportsChoicePools: true }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user