Skip to content

Commit aa729de

Browse files
committed
fix(test): wrong comment about getBy vs. queryBy
1 parent 1cf31a8 commit aa729de

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/react/src/components/__tests__/TodoInput.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ describe(TodoInput.name, () => {
7171

7272
// 💡 Change button name and observe the error. Then change getByRole to queryByRole and check it again.
7373
await userEvent.click(screen.getByRole('button', { name: 'Submit' }));
74-
// queryBy - throws error if element is not found
75-
// getBy - returns null if element is not found
74+
// getBy - throws error if element is not found
75+
// queryBy - returns null if element is not found
7676

7777
// ASSERT
7878
expect(onSubmit).not.toHaveBeenCalled();

packages/svelte/src/components/__tests__/TodoInput.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ describe('TodoInput', () => {
6363

6464
// 💡 Change button name and observe the error. Then change getByRole to queryByRole and check it again.
6565
await userEvent.click(screen.getByRole('button', { name: 'Submit' }));
66-
// queryBy - throws error if element is not found
67-
// getBy - returns null if element is not found
66+
// getBy - throws error if element is not found
67+
// queryBy - returns null if element is not found
6868

6969
// ASSERT
7070
expect(onSubmit).not.toHaveBeenCalled();

packages/vue/src/components/__tests__/TodoInput.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ describe('TodoInput', () => {
7878

7979
// 💡 Change button name and observe the error. Then change getByRole to queryByRole and check it again.
8080
await userEvent.click(screen.getByRole('button', { name: 'Submit' }));
81-
// queryBy - throws error if element is not found
82-
// getBy - returns null if element is not found
81+
// getBy - throws error if element is not found
82+
// queryBy - returns null if element is not found
8383

8484
// ASSERT
8585
expect(onSubmit).not.toHaveBeenCalled();

0 commit comments

Comments
 (0)