Skip to content

Commit 5f81a33

Browse files
committed
test: address review feedback on e2e tests
- colors: use cross-platform MOD modifier instead of hardcoded Control in the background-color-mark test, and document the post-insertHeading wait - emojipicker: wait before asserting the picker is absent so the negative check isn't won by a race - Dockerfile: align Corepack's prepared pnpm with the repo's packageManager pin (11.5.1)
1 parent 6015fb6 commit 5f81a33

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

tests/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ FROM mcr.microsoft.com/playwright:v1.51.1-noble
2424
WORKDIR /work
2525

2626
# pnpm matching the repo's packageManager.
27-
RUN corepack enable && corepack prepare pnpm@11.1.1 --activate
27+
RUN corepack enable && corepack prepare pnpm@11.5.1 --activate
2828

2929
# Copy ONLY the dependency manifests — every workspace member's package.json plus
3030
# the lockfile/workspace file — preserving their paths with --parents. These are

tests/src/end-to-end/colors/colors.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ describe("Check Background & Text Color Functionality", () => {
7070
await userEvent.keyboard("{Enter}");
7171
await insertHeading(3);
7272

73+
// Wait for the headings to finish rendering before navigating the caret,
74+
// otherwise the subsequent ArrowUp/selection can land in a stale layout.
7375
await sleep(500);
7476

7577
await userEvent.keyboard("{ArrowUp}");
@@ -97,9 +99,7 @@ describe("Check Background & Text Color Functionality", () => {
9799

98100
await userEvent.keyboard("{ArrowUp}");
99101
await userEvent.keyboard(`{${MOD}>}{ArrowLeft}{/${MOD}}`);
100-
await userEvent.keyboard(
101-
"{Control>}{Shift>}{ArrowRight}{/Shift}{/Control}",
102-
);
102+
await userEvent.keyboard(`{${MOD}>}{Shift>}{ArrowRight}{/Shift}{/${MOD}}`);
103103

104104
await userEvent.click(await waitForSelector(COLORS_BUTTON_SELECTOR));
105105
await userEvent.click(

tests/src/end-to-end/emojipicker/emojipicker.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ describe("Check Emoji Picker Functionality", () => {
2424
test("should not show emoji picker when : is typed", async () => {
2525
await focusOnEditor();
2626
await openEmojiPicker();
27+
// Give the editor a chance to (incorrectly) open the picker before
28+
// asserting its absence, so the negative check isn't won by a race.
29+
await sleep(500);
2730
expect(document.querySelectorAll(EMOJI_PICKER_SELECTOR).length).toBe(0);
2831
});
2932
test("should show emoji picker when : and query is typed", async () => {

0 commit comments

Comments
 (0)