Skip to content

Commit ffb03a2

Browse files
wpfleger96Duncan
andcommitted
test(agents): wait on the dismissal instead of a fixed delay
Co-authored-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz> Signed-off-by: Will Pfleger <[email protected]>
1 parent 7fee246 commit ffb03a2

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/bundled/agents/AgentsPage.test.tsx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6722,12 +6722,12 @@ describe("a team Save that finishes after its editor is gone", () => {
67226722
it("closes the editor once its Save succeeds, before the saved team arrives", async () => {
67236723
const f = await fixture({ refresh: false, nativeHistory: true });
67246724
try {
6725-
await act(async () => {
6726-
f.resolve();
6727-
await new Promise((r) => setTimeout(r, 10));
6728-
});
6725+
await act(async () => f.resolve());
6726+
// The dismissal lands on a later task; wait for it, then check the form.
6727+
await waitFor(() =>
6728+
expect(f.navigator.snapshot().entry.target).toEqual(base),
6729+
);
67296730
expect(screen.queryByRole("form", { name: "Edit Crew B" })).toBeNull();
6730-
expect(f.navigator.snapshot().entry.target).toEqual(base);
67316731
} finally {
67326732
f.dispose();
67336733
}

0 commit comments

Comments
 (0)