Skip to content

Commit 5e602a1

Browse files
committed
ifix(view): fix strict mode violation in undo-redo E2E test
getByText('Test') matched both command name "Test" and command code "npm test" Target command name element precisely using getByTestId("command-name")
1 parent 30cf581 commit 5e602a1

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/view/e2e/undo-redo.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,16 @@ test.describe("Undo/Redo Keyboard Shortcuts", () => {
9393
await page.getByRole("button", { name: /save/i }).click();
9494

9595
// Verify modification
96-
await expect(commandCards.first().getByText(newName)).toBeVisible();
96+
await expect(
97+
commandCards.first().getByTestId("command-name").getByText(newName)
98+
).toBeVisible();
9799

98100
// And: Undo with keyboard shortcut
99101
await page.keyboard.press("Control+z");
100102

101103
// Then: Original name should be restored
102-
await expect(commandCards.first().getByText(TEST_COMMAND.name)).toBeVisible();
104+
await expect(
105+
commandCards.first().getByTestId("command-name").getByText(TEST_COMMAND.name)
106+
).toBeVisible();
103107
});
104108
});

0 commit comments

Comments
 (0)