Rebuild CCS case workflow
This commit is contained in:
@@ -161,15 +161,40 @@ test("public API and disposable learner journey", async () => {
|
||||
expect(Array.isArray(cases)).toBeTruthy();
|
||||
expect(cases.length).toBeGreaterThan(0);
|
||||
const { data: attempt } = await call("/api/ccs/attempts", {
|
||||
method: "POST", token, body: { caseExternalId: "", mode: "practice" }
|
||||
method: "POST", token, body: { caseExternalId: "", mode: "timed" }
|
||||
});
|
||||
activeCcsAttempt = attempt.id;
|
||||
expect(activeCcsAttempt).toBeTruthy();
|
||||
expect(attempt.caseExternalId).toBeTruthy();
|
||||
expect(attempt.state).toBe("active");
|
||||
await call(`/api/ccs/attempts/${activeCcsAttempt}/abandon`, {
|
||||
method: "POST", token, expected: [204]
|
||||
const { data: opened } = await call(`/api/ccs/attempts/${activeCcsAttempt}/commands`, {
|
||||
method: "POST", token, body: {
|
||||
commandId: `smoke-opening-${suffix}`, expectedRevision: attempt.revision,
|
||||
type: "acknowledge_opening", code: "", minutes: 0
|
||||
}
|
||||
});
|
||||
expect(opened.openingCompleted).toBe(true);
|
||||
const exam = opened.availableExams[0];
|
||||
const { data: examined } = await call(`/api/ccs/attempts/${activeCcsAttempt}/commands/batch`, {
|
||||
method: "POST", token, body: {
|
||||
commandId: `smoke-exam-${suffix}`, expectedRevision: opened.revision,
|
||||
commands: [{ type: "exam", code: exam.code, minutes: 0 }]
|
||||
}
|
||||
});
|
||||
const { data: finalOrders } = await call(`/api/ccs/attempts/${activeCcsAttempt}/commands`, {
|
||||
method: "POST", token, body: {
|
||||
commandId: `smoke-final-${suffix}`, expectedRevision: examined.revision,
|
||||
type: "end_case", code: "", minutes: 0
|
||||
}
|
||||
});
|
||||
expect(finalOrders.state).toBe("final_orders");
|
||||
const { data: completedCcs } = await call(`/api/ccs/attempts/${activeCcsAttempt}/commands`, {
|
||||
method: "POST", token, body: {
|
||||
commandId: `smoke-complete-${suffix}`, expectedRevision: finalOrders.revision,
|
||||
type: "exit_case", code: "", minutes: 0
|
||||
}
|
||||
});
|
||||
expect(completedCcs.state).toBe("completed");
|
||||
activeCcsAttempt = "";
|
||||
|
||||
// Flashcards: create a deck and card, study and grade it, verify it drops out of the due
|
||||
|
||||
Reference in New Issue
Block a user