Skip to content

Commit a427612

Browse files
committed
Merge branch 'main' into pr-tabs-ready
2 parents 0231ea3 + 69913ae commit a427612

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

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/cypress/support/component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ addQwikLoader();
2020
// Import commands.ts using ES2015 syntax:
2121
import './commands';
2222
import 'cypress-axe';
23+
import 'axe-core';
2324

2425
// Augment the Cypress namespace to include type definitions for
2526
// your custom command.
@@ -30,11 +31,15 @@ declare global {
3031
namespace Cypress {
3132
interface Chainable {
3233
mount: typeof mount;
34+
checkA11yForComponent: () => void;
3335
}
3436
}
3537
}
3638

3739
Cypress.Commands.add('mount', mount);
40+
Cypress.Commands.add('checkA11yForComponent', () => {
41+
cy.checkA11y('[data-cy-root]');
42+
});
3843

3944
// Example use:
4045
// cy.mount(MyComponent)

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { mount } from 'cypress-ct-qwik';
21
import { Accordion, AccordionItem } from './accordion';
32

43
describe('Accordion', () => {
54
it('should render an Accordion', () => {
65
cy.mount(
7-
<Accordion>
6+
<Accordion class="accordion">
87
<AccordionItem label="Heading 1">
98
<p>
109
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus
@@ -20,12 +19,10 @@ describe('Accordion', () => {
2019
</Accordion>
2120
);
2221

23-
// cy.injectAxe();
24-
2522
cy.contains(/Heading 1/i).click();
2623
cy.get('.content').should('exist');
2724
cy.contains(/Heading 2/i).should('exist');
2825

29-
// cy.checkA11y();
26+
cy.checkA11yForComponent();
3027
});
3128
});

0 commit comments

Comments
 (0)