Gateway: changed files, search across hosts, a richer complication summary, and question options in pushes
This commit is contained in:
1 parent
45251b1a43
commit
b08fd9bdb1
13 files changed
+500
-19
No files matched your search
@@ -108,3 +108,40 @@ describe("Notifier", () => {
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("question pushes", () => {
|
||||
it("carry a lone single-choice question's options for the notification's buttons", async () => {
|
||||
const asking = shell({ pendingRuntimeRequest: { id: "q1", kind: "user_input", createdAt: "2026-11-01T09:00:00.000Z" } });
|
||||
const question = {
|
||||
id: "base",
|
||||
header: "Image",
|
||||
question: "Which base image?",
|
||||
options: [
|
||||
{ label: "bun:1-alpine", description: "" },
|
||||
{ label: "bun:1-debian", description: "", value: "debian" },
|
||||
],
|
||||
allowCustomAnswer: true,
|
||||
};
|
||||
const reading = {
|
||||
...host,
|
||||
bounded: () =>
|
||||
Promise.resolve({
|
||||
snapshotSequence: 1,
|
||||
projection: { thread: asking, messages: [], turnItems: [{ type: "user_input_request", requestId: "q1", questions: [question] }] },
|
||||
}),
|
||||
} as unknown as T3Host;
|
||||
const pushes: Push[] = [];
|
||||
const notifier = new Notifier(async (push) => void pushes.push(push), new SummaryCache());
|
||||
notifier.onThreadChange({ host: reading, previous: undefined, next: shell(), initial: true });
|
||||
notifier.onThreadChange({ host: reading, previous: shell(), next: asking, initial: false });
|
||||
await Bun.sleep(5);
|
||||
expect(pushes[0]?.data.question).toEqual({
|
||||
id: "base",
|
||||
options: [
|
||||
{ label: "bun:1-alpine", value: "bun:1-alpine" },
|
||||
{ label: "bun:1-debian", value: "debian" },
|
||||
],
|
||||
allowCustomAnswer: true,
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user