Skip to content

Commit

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

* chore(): add a11y test

* chore(): add changeset

* chore(): trigger build

* chore(): trigger build

* chore(): improve changeset

---------

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 13, 2024
1 parent d78e2a6 commit 819fe72
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-ads-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/design-system-components': patch
---

**progress-bar**: Added aria-hidden attribute to improve accessibility by preventing screen readers from unnecessarily announcing this element.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export class ProgressBar implements ComponentInterface, BalConfigObserver, BalBr

return (
<Host
aria-hidden="true"
class={{
...block.class(),
...block.modifier(`background-${this.background}`).class(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!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" />
<title>a11y</title>
<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">
<h1>a11y</h1>
<section class="mb-medium" data-testid="basic">
<bal-progress-bar value="50" background="grey"></bal-progress-bar>
</section>
</main>
</bal-doc-app>
</body>
</html>
11 changes: 11 additions & 0 deletions test/cypress/e2e/a11y/bal-progress-bar.a11y.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describe('bal-progress-bar', () => {
context('a11y', () => {
beforeEach(() => cy.platform('desktop').pageA11y('/components/bal-progress-bar/test/bal-progress-bar.a11y.html'))

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

0 comments on commit 819fe72

Please sign in to comment.