Skip to content

Commit

Permalink
test: add e2e test for typeahead menu attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
sodenn committed Feb 23, 2025
1 parent 6742465 commit 4633fa8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/lexical-playground/__tests__/e2e/Mentions.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
import {
assertHTML,
assertSelection,
expect,
focusEditor,
html,
initialize,
Expand Down Expand Up @@ -1019,4 +1020,16 @@ test.describe('Mentions', () => {
focusPath: [0, 1, 0],
});
});

test(`Sets correct attributes on typeahead menu container`, async ({
page,
}) => {
await focusEditor(page);
await page.keyboard.type('@a');

const menuElement = await page.locator('#typeahead-menu:has(:scope > *)');
expect(await menuElement.getAttribute('aria-label')).toBe('Typeahead menu');
expect(await menuElement.getAttribute('id')).toBe('typeahead-menu');
expect(await menuElement.getAttribute('role')).toBe('listbox');
});
});

0 comments on commit 4633fa8

Please sign in to comment.