test: wait for publish report controls

This commit is contained in:
Oleg Isonen committed 2026-11-15 11:36:39 +00:00
1 parent e0fb3e32d6
commit c322938c97
2 files changed
+10 -5

No files matched your search

@@ -547,10 +547,15 @@ test("an accepted site failure links to its own publish log", async () => {
await dispatch.promise;
});
const errors = await openErrors("site");
const showLogs = Array.from(
errors?.querySelectorAll<HTMLButtonElement>("button") ?? []
).find((button) => button.textContent?.trim() === "show logs");
expect(showLogs).toBeDefined();
const findShowLogs = () =>
Array.from(
errors?.querySelectorAll<HTMLButtonElement>("button") ?? []
).find((button) => button.textContent?.trim() === "show logs");
await vi.waitFor(async () => {
await act(async () => {});
expect(findShowLogs()).toBeDefined();
});
const showLogs = findShowLogs();
await act(async () => showLogs?.click());
expect(
document.body.querySelector('[role="tab"][aria-selected="true"]')
@@ -180,7 +180,7 @@ const click = async (label: string) => {
const target = button(label);
expect(target).toBeDefined();
expect(target?.disabled).toBe(false);
await act(async () => target?.click());
await act(async () => userEvent.click(target!));
};
const mount = async (projectId = "project") => {
await act(async () =>