feat: add question type presentation controls

This commit is contained in:
Erik Kotsiuba
2026-05-06 12:44:37 +02:00
parent b218b8b188
commit f1a0a5d5e5
28 changed files with 761 additions and 44 deletions
+29
View File
@@ -190,6 +190,35 @@ test("question mark opens ask settings outside non-empty editors", () => {
});
});
test("question type shortcut uses configured main keymap", () => {
const state = createInitialState({
questions: [
{
id: "q1",
prompt: "Question?",
options: [{ value: "a", label: "A" }],
},
],
});
const config = {
...DEFAULT_ASK_CONFIG,
keymaps: {
...DEFAULT_ASK_CONFIG.keymaps,
main: {
...DEFAULT_ASK_CONFIG.keymaps.main,
changeQuestionType: ["ctrl+t"],
},
},
};
assert.deepEqual(getInputCommand(state, DEFAULT_ASK_CONFIG, "t"), {
kind: "changeQuestionType",
});
assert.deepEqual(getInputCommand(state, config, "\u0014"), {
kind: "changeQuestionType",
});
});
test("note shortcuts use n for option notes and Shift+N for question notes", () => {
const navigation = createInitialState({
questions: [