fix(webui): simplify temporary chat closing
This commit is contained in:
@@ -469,10 +469,9 @@ describe("App layout", () => {
|
||||
expect(screen.getByText("Temporary chat")).toBeInTheDocument();
|
||||
expect(screen.queryByRole("button", { name: "Temporary chat" })).not.toBeInTheDocument();
|
||||
|
||||
fireEvent.pointerDown(within(sidebar).getByRole("button", {
|
||||
name: "Topic actions for first private message",
|
||||
}), { button: 0 });
|
||||
fireEvent.click(await screen.findByRole("menuitem", { name: "Close temporary chat" }));
|
||||
fireEvent.click(within(sidebar).getByRole("button", {
|
||||
name: "Close temporary chat: first private message",
|
||||
}));
|
||||
await waitFor(() => expect(window.location.hash).toBe(secondHash));
|
||||
expect(within(sidebar).queryByRole("button", {
|
||||
name: "first private message",
|
||||
|
||||
@@ -179,14 +179,9 @@ describe("ChatList", () => {
|
||||
fireEvent.click(within(section).getByRole("button", { name: "Private planning" }));
|
||||
expect(onSelect).toHaveBeenCalledWith("temporary:temporary-one");
|
||||
|
||||
fireEvent.pointerDown(
|
||||
within(section).getByRole("button", { name: "Topic actions for Private planning" }),
|
||||
{ button: 0 },
|
||||
);
|
||||
const closeItem = await screen.findByRole("menuitem", { name: "Close temporary chat" });
|
||||
expect(closeItem).toHaveTextContent("Close");
|
||||
expect(closeItem).toHaveClass("whitespace-nowrap");
|
||||
fireEvent.click(closeItem);
|
||||
fireEvent.click(within(section).getByRole("button", {
|
||||
name: "Close temporary chat: Private planning",
|
||||
}));
|
||||
expect(onClose).toHaveBeenCalledWith("temporary:temporary-one");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user