Skip to content

Commit

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

* chore(): add a11y test

---------

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 Feb 12, 2024
1 parent 9797912 commit 5b6361f
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!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>
<body>
<bal-doc-app>
<main class="container py-medium">
<section data-testid="basic">
<bal-pagination page-range="2" total-pages="20" value="2"></bal-pagination>
</section>
<br />
<br />
<section data-testid="small">
<bal-pagination interface="small" total-pages="10"></bal-pagination>
</section>
<br />
<br />
<section data-testid="small-with-dots">
<bal-pagination interface="small" total-pages="3"></bal-pagination>
</section>
</main>
</bal-doc-app>
</body>
</body>
</html>
19 changes: 19 additions & 0 deletions test/cypress/e2e/a11y/bal-pagination.a11y.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
describe('bal-pagination', () => {
context('a11y', () => {
beforeEach(() => cy.platform('desktop').pageA11y('/components/bal-pagination/test/bal-pagination.a11y.html'))

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

it('pagination small', () => {
cy.getByTestId('small').testA11y()
})

it('pagination small with dots', () => {
cy.getByTestId('small-with-dots').testA11y()
})
})
})
})

0 comments on commit 5b6361f

Please sign in to comment.