Skip to content

Commit

Permalink
♿ a11y(bal-shape): write test to prove AA-Standard (#1256)
Browse files Browse the repository at this point in the history
* Create PR for #1212

* chore(): add shape accessibility test

* chore(): trigger build

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mladen Planinicic <[email protected]>
  • Loading branch information
github-actions[bot] and Mladen Planinicic authored Jan 19, 2024
1 parent b72e947 commit 82aef21
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_v12.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,3 +547,4 @@ Follow the migration guide [Migration from 10.x to 11.x](https://baloise-design-
- Rebranded components
- New breakpoint high-definition
- bal-input pattern

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

<script type="module" src="/build/design-system-components.esm.js"></script>
<script nomodule src="/build/design-system-components.js"></script>
</head>

<body>
<bal-doc-app>
<main class="container py-medium">
<section>
<bal-shape data-testid="basic"></bal-shape>
</section>
</main>
</bal-doc-app>
</body>
</html>
22 changes: 22 additions & 0 deletions test/cypress/e2e/a11y/bal-shape.a11y.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
describe('bal-shape', () => {
context('a11y', () => {
beforeEach(() => cy.platform('desktop').pageA11y('/components/bal-shape/test/bal-shape.cy.html'))

describe('have the AA standard', () => {
it('basic', () => {
cy.getByTestId('basic').testA11y()
})

testColorA11y(['green', 'green-light', 'red', 'red-light', 'purple', 'purple-light', 'yellow', 'yellow-light'])
})
})
})

function testColorA11y(colors: BalProps.BalShapeColor[]) {
for (let index = 0; index < colors.length; index++) {
const color = colors[index]
it(`color ${color}`, () => {
cy.getByTestId('basic').setProperty('color', color).testA11y()
})
}
}

0 comments on commit 82aef21

Please sign in to comment.