-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(): add logo accessibility test
- Loading branch information
Mladen Planinicic
committed
Dec 28, 2023
1 parent
6770f3f
commit 634b6c2
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
packages/components/src/components/bal-logo/test/bal-logo.cy.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" /> | ||
<link rel="stylesheet" href="/assets/baloise-design-system.css" /> | ||
<script type="module" src="/build/design-system-components.esm.js"></script> | ||
<script nomodule src="/build/design-system-components.js"></script> | ||
</head> | ||
|
||
<body> | ||
<bal-app> | ||
<div class="container"> | ||
<h2 class="title is-size-xx-large">Basic</h2> | ||
<section> | ||
<bal-logo data-testid="basic"></bal-logo> | ||
</section> | ||
</div> | ||
</bal-app> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
}) | ||
} | ||
} |