Skip to content

Commit

Permalink
Add tests for banner role
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Oct 18, 2021
1 parent ce42cbd commit 894b685
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/__tests__/role-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ afterEach(() => {

function setup() {
const {getByTestId} = render(`
<header data-testid="a-header">Banner header</header>
<section aria-label="a region" data-testid='named-section'>
<a href="http://whatever.com" data-testid="a-link">link</a>
<a>invalid link</a>
Expand Down Expand Up @@ -105,6 +106,7 @@ function setup() {
textarea: getByTestId('a-textarea'),
dt: getByTestId('a-dt'),
dd: getByTestId('a-dd'),
header: getByTestId('a-header'),
}
}

Expand Down Expand Up @@ -139,6 +141,7 @@ test('getRoles returns expected roles for various dom nodes', () => {
namedForm,
dd,
dt,
header,
} = setup()

expect(getRoles(namedSection)).toEqual({
Expand All @@ -161,6 +164,9 @@ test('getRoles returns expected roles for various dom nodes', () => {
term: [dt],
definition: [dd],
})
expect(getRoles(header)).toEqual({
banner: [header],
})
})

test('logRoles calls console.log with output from prettyRoles', () => {
Expand Down

0 comments on commit 894b685

Please sign in to comment.