Skip to content

Commit 63b6f3f

Browse files
committed
Make use of new *byRole capabilities
1 parent 6739874 commit 63b6f3f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/__tests__/components/Validate.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
aria-labelledby="username-label"
1111
/>
1212

13-
<span v-show="errors.has('username')" data-testid="username-errors">{{
13+
<span v-if="errors.has('username')" data-testid="username-errors">{{
1414
errors.first('username')
1515
}}</span>
1616

tests/__tests__/form.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test('Review form submits', async () => {
1414
const {
1515
getByLabelText,
1616
getByText,
17-
getByTestId,
17+
getByRole,
1818
getByDisplayValue,
1919
getByPlaceholderText,
2020
emitted
@@ -44,7 +44,8 @@ test('Review form submits', async () => {
4444
const genreSelect = getByDisplayValue('Comedy')
4545
await fireEvent.update(genreSelect, fakeReview.genre)
4646

47-
const recommendInput = getByTestId('recommend-checkbox')
47+
// Get the Input element by its implicit ARIA role.
48+
const recommendInput = getByRole('checkbox')
4849
await fireEvent.update(recommendInput, fakeReview.recommend)
4950

5051
// NOTE: in jsdom, it's not possible to trigger a form submission

0 commit comments

Comments
 (0)