Skip to content

Commit 0069b2e

Browse files
shaireznaorpeled
andcommitted
test: added cypress a11y testing
Co-authored-by: Naor Peled <[email protected]>
1 parent b874111 commit 0069b2e

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

packages/kit-headless/cypress.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ export default defineConfig({
66
devServer: {
77
framework: 'cypress-ct-qwik',
88
bundler: 'vite',
9-
},
9+
} as any,
1010
},
1111
});

packages/kit-headless/cypress/support/component-index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
55
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

packages/kit-headless/src/components/accordion/accordion.spec.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import { Accordion, AccordionItem } from './accordion';
33

44
describe('Accordion', () => {
55
it('should render an Accordion', () => {
6+
cy.injectAxe({ axeCorePath: '../../node_modules/axe-core/axe.min.js' });
67
mount(
7-
<Accordion>
8+
<Accordion class="accordion">
89
<AccordionItem label="Heading 1">
910
<p>
1011
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus
@@ -20,12 +21,10 @@ describe('Accordion', () => {
2021
</Accordion>
2122
);
2223

23-
// cy.injectAxe();
24-
2524
cy.contains(/Heading 1/i).click();
2625
cy.get('.content').should('exist');
2726
cy.contains(/Heading 2/i).should('exist');
2827

29-
// cy.checkA11y();
28+
cy.checkA11y('[data-cy-root]');
3029
});
3130
});

0 commit comments

Comments
 (0)