add hasNodeError for tests
This commit is contained in:
@@ -40,7 +40,8 @@ const mockUseDevice = {
|
|||||||
messages: { broadcast: new Map(), direct: new Map() },
|
messages: { broadcast: new Map(), direct: new Map() },
|
||||||
metadata: new Map(),
|
metadata: new Map(),
|
||||||
unreadCounts: new Map([[1111, 3], [2222, 10]]),
|
unreadCounts: new Map([[1111, 3], [2222, 10]]),
|
||||||
setUnread: vi.fn()
|
setUnread: vi.fn(),
|
||||||
|
hasNodeError: vi.fn()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ describe("Messages Page", () => {
|
|||||||
|
|
||||||
it("does not update the incorrect node", async () => {
|
it("does not update the incorrect node", async () => {
|
||||||
render(<MessagesPage />);
|
render(<MessagesPage />);
|
||||||
const nodeButton = screen.getAllByRole("button").filter(b => b.textContent.includes("TN1Test Node 13"))[0];
|
const nodeButton = screen.getAllByRole("button").filter(b => b.textContent.includes("TN1Test Node 1"))[0];
|
||||||
fireEvent.click(nodeButton);
|
fireEvent.click(nodeButton);
|
||||||
expect(mockUseDevice.setUnread).toHaveBeenCalledWith(1111, 0);
|
expect(mockUseDevice.setUnread).toHaveBeenCalledWith(1111, 0);
|
||||||
expect(mockUseDevice.unreadCounts.get(2222)).toBe(10);
|
expect(mockUseDevice.unreadCounts.get(2222)).toBe(10);
|
||||||
|
|||||||
Reference in New Issue
Block a user