fix(chess): global Esc handler + stable test selectors for layouts e2e
- LayoutEditor: move Esc handling to a window keydown listener so the modal closes regardless of where focus currently sits (the prior onKeyDown on the modal div only fired when the root div itself held focus). - LayoutPicker: add data-testid on the description <p> so e2e assertions can target it unambiguously instead of relying on free-text matches that also select the hidden <option> labels. - e2e: use the new testid. All 12 layouts e2e tests pass; existing multiplayer + full-flow e2e suites still green.
This commit is contained in:
parent
832ebe9cd6
commit
89c22d6bd5
3 changed files with 21 additions and 3 deletions
|
|
@ -52,7 +52,9 @@ test.describe('LayoutPicker (lobby)', () => {
|
|||
test('selecting Dunsany updates the description', async ({ page }) => {
|
||||
const picker = page.getByTestId('layout-picker');
|
||||
await picker.selectOption('dunsany');
|
||||
await expect(page.locator('text=/Dunsany/i').first()).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId('layout-picker-description'),
|
||||
).toContainText(/pawn tide/i);
|
||||
});
|
||||
|
||||
test('?layoutId=dunsany query param pre-selects the layout', async ({ page }) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue