mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-13 07:39:15 +03:00
test(webui): await lazy settings import deterministically
This commit is contained in:
@@ -441,8 +441,12 @@ describe("App layout", () => {
|
|||||||
const sidebar = screen.getByRole("navigation", { name: "Sidebar navigation" });
|
const sidebar = screen.getByRole("navigation", { name: "Sidebar navigation" });
|
||||||
fireEvent.click(within(sidebar).getByRole("button", { name: "Settings" }));
|
fireEvent.click(within(sidebar).getByRole("button", { name: "Settings" }));
|
||||||
|
|
||||||
|
await act(async () => {
|
||||||
|
await import("@/components/settings/SettingsView");
|
||||||
|
});
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
await screen.findByRole("navigation", { name: "Settings sections" }),
|
screen.getByRole("navigation", { name: "Settings sections" }),
|
||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
expect(container.querySelectorAll("main")).toHaveLength(1);
|
expect(container.querySelectorAll("main")).toHaveLength(1);
|
||||||
expect(screen.getByRole("heading", { level: 1, name: "Settings" })).toBeInTheDocument();
|
expect(screen.getByRole("heading", { level: 1, name: "Settings" })).toBeInTheDocument();
|
||||||
|
|||||||
Reference in New Issue
Block a user