Skip to content

Commit 7cf5496

Browse files
author
Aaron Pettengill
committed
fix: Link to spec and correct terminology
1 parent 81c50ba commit 7cf5496

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/__tests__/element-queries.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ test('can filter results of label query based on selector', () => {
229229
expect(result[0].id).toBe('input1')
230230
})
231231

232-
test('can find any form control when label text is inside other elements', () => {
232+
test('can find any labelable element when label text is inside other elements', () => {
233233
const {getByLabelText} = render(`
234234
<label>
235235
<span>Test</span>
@@ -260,7 +260,9 @@ test('can find any form control when label text is inside other elements', () =>
260260
})
261261
})
262262

263-
test('returns the first form control inside a label', () => {
263+
// According to the spec, the first descendant of a label that is a labelable element is the labeled control
264+
// https://html.spec.whatwg.org/multipage/forms.html#the-label-element
265+
test('returns the labelable element control inside a label', () => {
264266
const {getByLabelText} = render(`
265267
<label>
266268
<span>Test</span>

0 commit comments

Comments
 (0)