fix(dashboard-tests): align remaining ChatView send assertions with FN-8502 delivery callbacks
Same drift as chat-commands/mobile: sendMessage gained the {onDelivered,onFailed}
third argument; autosize and draft suites now expect it.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -155,7 +155,9 @@ describe("ChatView composer autosize", () => {
|
||||
await userEvent.click(screen.getAllByTestId("chat-send-btn")[0]);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(sendMessage).toHaveBeenCalledWith("line one\nline two\nline three", []);
|
||||
// FNXC:ChatAttachments 2026-07-23-23:59:
|
||||
// FN-8502 (1cd06746f) added the delivery-callback bag as sendMessage's third argument.
|
||||
expect(sendMessage).toHaveBeenCalledWith("line one\nline two\nline three", [], expect.objectContaining({ onDelivered: expect.any(Function), onFailed: expect.any(Function) }));
|
||||
expect(textarea).toHaveValue("");
|
||||
const resetHeight = Number.parseInt(textarea.style.height, 10);
|
||||
expect(resetHeight).toBeLessThan(expandedHeight);
|
||||
|
||||
@@ -200,7 +200,9 @@ describe("ChatView draft persistence", () => {
|
||||
await userEvent.click(screen.getAllByTestId("chat-send-btn")[0]);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(sendMessage).toHaveBeenCalledWith("send me", []);
|
||||
// FNXC:ChatAttachments 2026-07-23-23:59:
|
||||
// FN-8502 (1cd06746f) added the delivery-callback bag as sendMessage's third argument.
|
||||
expect(sendMessage).toHaveBeenCalledWith("send me", [], expect.objectContaining({ onDelivered: expect.any(Function), onFailed: expect.any(Function) }));
|
||||
expect(screen.getByPlaceholderText("Type a message...")).toHaveValue("");
|
||||
expect(localStorage.getItem("fusion:chat-draft:direct:session-001")).toBeNull();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user