From d8ad480460f23212a017539d83944b10b5d83751 Mon Sep 17 00:00:00 2001 From: David Russell Date: Wed, 22 May 2024 12:15:22 +0100 Subject: [PATCH] add e2e tests --- .../src/e2e_tests/configuration.spec.tsx | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/packages/react-codemirror/src/e2e_tests/configuration.spec.tsx b/packages/react-codemirror/src/e2e_tests/configuration.spec.tsx index d44926a1..addb2273 100644 --- a/packages/react-codemirror/src/e2e_tests/configuration.spec.tsx +++ b/packages/react-codemirror/src/e2e_tests/configuration.spec.tsx @@ -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(); + + 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(); + + const textField = page.getByRole('textbox'); + + await expect(async () => { + expect(await textField.getAttribute('aria-label')).toEqual(ariaLabel); + }).toPass(); +});