feat(question): support multi-select questions (#7386)

This commit is contained in:
Dax
2026-01-08 17:32:21 -05:00
committed by GitHub
parent b4f8de0c0a
commit 22dd70b75b
10 changed files with 1411 additions and 325 deletions

View File

@@ -82,11 +82,11 @@ test("reply - resolves the pending ask with answers", async () => {
await Question.reply({
requestID,
answers: ["Option 1"],
answers: [["Option 1"]],
})
const answers = await askPromise
expect(answers).toEqual(["Option 1"])
expect(answers).toEqual([["Option 1"]])
},
})
})
@@ -115,7 +115,7 @@ test("reply - removes from pending list", async () => {
await Question.reply({
requestID: pending[0].id,
answers: ["Option 1"],
answers: [["Option 1"]],
})
const pendingAfter = await Question.list()
@@ -131,7 +131,7 @@ test("reply - does nothing for unknown requestID", async () => {
fn: async () => {
await Question.reply({
requestID: "que_unknown",
answers: ["Option 1"],
answers: [["Option 1"]],
})
// Should not throw
},
@@ -244,11 +244,11 @@ test("ask - handles multiple questions", async () => {
await Question.reply({
requestID: pending[0].id,
answers: ["Build", "Dev"],
answers: [["Build"], ["Dev"]],
})
const answers = await askPromise
expect(answers).toEqual(["Build", "Dev"])
expect(answers).toEqual([["Build"], ["Dev"]])
},
})
})