From 634b6c2319db2c00df278e361e63801519e199b6 Mon Sep 17 00:00:00 2001 From: Mladen Planinicic Date: Thu, 28 Dec 2023 15:04:28 +0100 Subject: [PATCH] chore(): add logo accessibility test --- .../components/bal-logo/test/bal-logo.cy.html | 22 +++++++++++++ test/cypress/e2e/a11y/bal-logo.a11y.cy.ts | 32 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 packages/components/src/components/bal-logo/test/bal-logo.cy.html create mode 100644 test/cypress/e2e/a11y/bal-logo.a11y.cy.ts diff --git a/packages/components/src/components/bal-logo/test/bal-logo.cy.html b/packages/components/src/components/bal-logo/test/bal-logo.cy.html new file mode 100644 index 0000000000..218dcd2b8a --- /dev/null +++ b/packages/components/src/components/bal-logo/test/bal-logo.cy.html @@ -0,0 +1,22 @@ + + + + + + + + + + + + + +
+

Basic

+
+ +
+
+
+ + diff --git a/test/cypress/e2e/a11y/bal-logo.a11y.cy.ts b/test/cypress/e2e/a11y/bal-logo.a11y.cy.ts new file mode 100644 index 0000000000..5c4762d1de --- /dev/null +++ b/test/cypress/e2e/a11y/bal-logo.a11y.cy.ts @@ -0,0 +1,32 @@ +describe('bal-logo', () => { + context('a11y', () => { + beforeEach(() => cy.platform('desktop').pageA11y('/components/bal-logo/test/bal-logo.cy.html')) + + describe('have the AA standard', () => { + it('basic', () => { + cy.getByTestId('basic').testA11y() + }) + + testColorA11y(['blue', 'white']) + testSizeA11y(['small']) + }) + }) +}) + +function testColorA11y(colors: BalProps.BalLogoColor[]) { + for (let index = 0; index < colors.length; index++) { + const color = colors[index] + it(`color ${color}`, () => { + cy.getByTestId('basic').setProperty('color', color).testA11y() + }) + } +} + +function testSizeA11y(sizes: BalProps.BalLogoSize[]) { + for (let index = 0; index < sizes.length; index++) { + const size = sizes[index] + it(`size ${size}`, () => { + cy.getByTestId('basic').setProperty('size', size).testA11y() + }) + } +}