Skip to content

Commit

Permalink
Add additional assertion to markMessageAsRead no-op test
Browse files Browse the repository at this point in the history
  • Loading branch information
fjsj committed Dec 30, 2024
1 parent 2d9d27e commit 7bb52c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion __tests__/hooks/headless/useChatMessages.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -661,13 +661,14 @@ describe("useChatMessages", () => {
// Wait for initial load
await waitFor(() => {
expect(result.current.loading).toBe(false);
const message = result.current.messages.find((m) => m.id === newMessage.id);
expect(message?.read).toBe(true);
});

// Mark message as read
await act(async () => {
await result.current.markMessageAsRead(newMessage.id!);
});

// Verify message is still marked as read
await waitFor(() => {
const message = result.current.messages.find((m) => m.id === newMessage.id);
Expand Down

0 comments on commit 7bb52c7

Please sign in to comment.