feat(webui): refine automation calendar workflows
This commit is contained in:
1 parent
98b0c3858b
commit
37e29c36e5
25 files changed
+1789
-487
No files matched your search
@@ -1601,6 +1601,40 @@ describe("ThreadShell", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("consumes an automation-page first message through the normal thread stream", async () => {
|
||||
const client = makeClient();
|
||||
const consumed = vi.fn();
|
||||
const pendingFirstMessage = {
|
||||
id: "automation-first-message",
|
||||
chatId: "chat-new",
|
||||
content: "Every weekday at 9, summarize open pull requests",
|
||||
};
|
||||
|
||||
render(
|
||||
wrap(
|
||||
client,
|
||||
<StrictMode>
|
||||
<ThreadShell
|
||||
session={session("chat-new")}
|
||||
title="New automation chat"
|
||||
onToggleSidebar={() => {}}
|
||||
pendingFirstMessage={pendingFirstMessage}
|
||||
onPendingFirstMessageConsumed={consumed}
|
||||
/>
|
||||
</StrictMode>,
|
||||
),
|
||||
);
|
||||
|
||||
await waitFor(() => expectSendMessageWithTurn(
|
||||
client,
|
||||
"chat-new",
|
||||
pendingFirstMessage.content,
|
||||
));
|
||||
expect(client.sendMessage).toHaveBeenCalledTimes(1);
|
||||
expect(consumed).toHaveBeenCalledOnce();
|
||||
expect(consumed).toHaveBeenCalledWith(pendingFirstMessage.id);
|
||||
});
|
||||
|
||||
it("keeps the first landing message when new chat history is still empty", async () => {
|
||||
const client = makeClient();
|
||||
const onCreateChat = vi.fn().mockResolvedValue("chat-new");
|
||||
|
||||
Reference in new issue
Block a user