Skip to content

Commit

Permalink
add e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daveajrussell committed May 22, 2024
1 parent 64a0833 commit d8ad480
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/react-codemirror/src/e2e_tests/configuration.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,25 @@ test('can set/unset onFocus/onBlur', async ({ mount, page }) => {
expect(blurFireCount).toBe(1);
}).toPass();
});

test('aria-label is not set by default', async ({ mount, page }) => {
await mount(<CypherEditor />);

const textField = page.getByRole('textbox');

await expect(async () => {
expect(await textField.getAttribute('aria-label')).toBeNull();
}).toPass();
});

test('can set aria-label', async ({ mount, page }) => {
const ariaLabel = 'Cypher Editor';

await mount(<CypherEditor ariaLabel={ariaLabel} />);

const textField = page.getByRole('textbox');

await expect(async () => {
expect(await textField.getAttribute('aria-label')).toEqual(ariaLabel);
}).toPass();
});

0 comments on commit d8ad480

Please sign in to comment.