test: cover note editor enter behavior

This commit is contained in:
Erik Kotsiuba
2026-04-28 22:35:43 +02:00
parent c9930b494f
commit b030b90257
3 changed files with 23 additions and 2 deletions
+21
View File
@@ -66,6 +66,27 @@ test("submitEditorDraft advances submitted custom answers", () => {
assert.equal(next.view.kind, "submit");
});
test("submitEditorDraft saves notes without completing the ask flow", () => {
const state = enterQuestionNoteMode(
createInitialState({
questions: [
{
id: "q1",
prompt: "Question?",
options: [{ value: "a", label: "A" }],
},
],
}),
"q1"
);
const next = submitEditorDraft(state, "needs examples");
assert.equal(next.answers.q1.note, "needs examples");
assert.equal(next.view.kind, "navigate");
assert.equal(next.completed, false);
assert.equal(next.cancelled, false);
});
test("getEditorDraft reads saved note and custom text from view", () => {
let state = syncStateToSelection({
...createInitialState({