Skip to content

Commit 8b6c3c7

Browse files
loganjLarry
andcommitted
test(composer): wait for the toolbar entrance after closing formatting
Closing formatting remounts the composer toolbar with a 140 ms fade-in. The project picker remount test checked toBeVisible() right after the reread started, so a slow runner could sample the trigger before the first animation frame, at opacity 0. Main 76c1d9f failed this way in CI. Keep the immediate check that the trigger stays present and disabled during the reread, then wait for the fade to finish before checking visibility. Delaying requestAnimationFrame by 300 ms reproduces the old failure at the same line and passes with this change. Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Signed-off-by: Logan Johnson <[email protected]>
1 parent 76c1d9f commit 8b6c3c7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/features/messages/MessageComposer.test.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5739,7 +5739,9 @@ describe("project resource picker", () => {
57395739
p.homes.mock.calls.filter(([id]) => id === "channel").length,
57405740
).toBeGreaterThan(1),
57415741
);
5742-
expect(trigger()).toBeVisible();
5742+
expect(trigger()).toBeDisabled();
5743+
// Closing formatting fades the toolbar back in; wait for that entrance.
5744+
await waitFor(() => expect(trigger()).toBeVisible());
57435745
expect(trigger()).toBeDisabled();
57445746
fireEvent.click(trigger());
57455747
expect(

0 commit comments

Comments
 (0)