Skip to content

Commit ce42cbd

Browse files
committed
Add tests for term and definition roles
1 parent 1421081 commit ce42cbd

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/__tests__/__snapshots__/role-helpers.js.snap

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,5 +200,21 @@ Name "":
200200
data-testid="a-textarea"
201201
/>
202202
203+
--------------------------------------------------
204+
term:
205+
206+
Name "":
207+
<dt
208+
data-testid="a-dt"
209+
/>
210+
211+
--------------------------------------------------
212+
definition:
213+
214+
Name "":
215+
<dd
216+
data-testid="a-dd"
217+
/>
218+
203219
--------------------------------------------------
204220
`;

src/__tests__/role-helpers.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ function setup() {
6666
<form data-testid="a-form" />
6767
<section data-testid="a-section" />
6868
</article>
69+
<dl>
70+
<dt data-testid="a-dt">Term</dt>
71+
<dd data-testid="a-dd">Definition</dd>
72+
</dl>
6973
</section>
7074
`)
7175

@@ -99,6 +103,8 @@ function setup() {
99103
input: getByTestId('a-input-1'),
100104
input2: getByTestId('a-input-2'),
101105
textarea: getByTestId('a-textarea'),
106+
dt: getByTestId('a-dt'),
107+
dd: getByTestId('a-dd'),
102108
}
103109
}
104110

@@ -131,6 +137,8 @@ test('getRoles returns expected roles for various dom nodes', () => {
131137
textarea,
132138
namedSection,
133139
namedForm,
140+
dd,
141+
dt,
134142
} = setup()
135143

136144
expect(getRoles(namedSection)).toEqual({
@@ -150,6 +158,8 @@ test('getRoles returns expected roles for various dom nodes', () => {
150158
menuitem: [menuItem, menuItem2],
151159
form: [namedForm],
152160
region: [namedSection],
161+
term: [dt],
162+
definition: [dd],
153163
})
154164
})
155165

0 commit comments

Comments
 (0)