diff --git a/packages/components/src/components/bal-badge/test/bal-badge.a11y.html b/packages/components/src/components/bal-badge/test/bal-badge.a11y.html new file mode 100644 index 0000000000..eb788757ff --- /dev/null +++ b/packages/components/src/components/bal-badge/test/bal-badge.a11y.html @@ -0,0 +1,21 @@ + + + + + + + + + + + + + +
+
+ 42 +
+
+
+ + diff --git a/test/cypress/e2e/a11y/bal-badge.a11y.cy.ts b/test/cypress/e2e/a11y/bal-badge.a11y.cy.ts new file mode 100644 index 0000000000..4daa12b97c --- /dev/null +++ b/test/cypress/e2e/a11y/bal-badge.a11y.cy.ts @@ -0,0 +1,36 @@ +import { findPropertyValuesByTag } from '../../support/a11y.utils' + +describe('bal-badge', () => { + context('a11y', () => { + beforeEach(() => cy.platform('desktop').pageA11y('/components/bal-badge/test/bal-badge.a11y.html')) + + describe('have the AA standard', () => { + it('basic', () => { + cy.getByTestId('basic').testA11y() + }) + + testColorA11y() + testSizeA11y() + }) + }) +}) + +function testColorA11y() { + const colors = findPropertyValuesByTag('bal-badge', 'color') + for (let index = 0; index < colors.length; index++) { + const color = colors[index] + it(`color ${color}`, () => { + cy.getByTestId('basic').setProperty('color', color).testA11y() + }) + } +} + +function testSizeA11y() { + const sizes = findPropertyValuesByTag('bal-badge', 'size') + for (let index = 0; index < sizes.length; index++) { + const size = sizes[index] + it(`size ${size}`, () => { + cy.getByTestId('basic').setProperty('size', size).testA11y() + }) + } +}