Skip to content

Commit

Permalink
Add tests for term and definition roles
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Oct 18, 2021
1 parent 1421081 commit ce42cbd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/__tests__/__snapshots__/role-helpers.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,21 @@ Name "":
data-testid="a-textarea"
/>
--------------------------------------------------
term:
Name "":
<dt
data-testid="a-dt"
/>
--------------------------------------------------
definition:
Name "":
<dd
data-testid="a-dd"
/>
--------------------------------------------------
`;
10 changes: 10 additions & 0 deletions src/__tests__/role-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ function setup() {
<form data-testid="a-form" />
<section data-testid="a-section" />
</article>
<dl>
<dt data-testid="a-dt">Term</dt>
<dd data-testid="a-dd">Definition</dd>
</dl>
</section>
`)

Expand Down Expand Up @@ -99,6 +103,8 @@ function setup() {
input: getByTestId('a-input-1'),
input2: getByTestId('a-input-2'),
textarea: getByTestId('a-textarea'),
dt: getByTestId('a-dt'),
dd: getByTestId('a-dd'),
}
}

Expand Down Expand Up @@ -131,6 +137,8 @@ test('getRoles returns expected roles for various dom nodes', () => {
textarea,
namedSection,
namedForm,
dd,
dt,
} = setup()

expect(getRoles(namedSection)).toEqual({
Expand All @@ -150,6 +158,8 @@ test('getRoles returns expected roles for various dom nodes', () => {
menuitem: [menuItem, menuItem2],
form: [namedForm],
region: [namedSection],
term: [dt],
definition: [dd],
})
})

Expand Down

0 comments on commit ce42cbd

Please sign in to comment.