Skip to content

Commit e8e17e9

Browse files
committed
refactor: self code review
1 parent c225b1d commit e8e17e9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/matchers/__tests__/to-be-checked.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ test('throws error for invalid role', () => {
209209
const unchecked = screen.getByTestId('adjustable-unchecked');
210210

211211
expect(() => expect(checked).toBeChecked()).toThrowErrorMatchingInlineSnapshot(
212-
`"toBeChecked() works only on "Switch" element or accessibility elements with "checkbox" or "radio" role."`,
212+
`"toBeChecked() works only on "Switch" elements or accessibility elements with "checkbox" or "radio" role."`,
213213
);
214214
expect(() => expect(unchecked).not.toBeChecked()).toThrowErrorMatchingInlineSnapshot(
215-
`"toBeChecked() works only on "Switch" element or accessibility elements with "checkbox" or "radio" role."`,
215+
`"toBeChecked() works only on "Switch" elements or accessibility elements with "checkbox" or "radio" role."`,
216216
);
217217
});
218218

@@ -221,6 +221,6 @@ test('throws error for non-accessibility element', () => {
221221

222222
const view = screen.getByTestId('test');
223223
expect(() => expect(view).toBeChecked()).toThrowErrorMatchingInlineSnapshot(
224-
`"toBeChecked() works only on "Switch" element or accessibility elements with "checkbox" or "radio" role."`,
224+
`"toBeChecked() works only on "Switch" elements or accessibility elements with "checkbox" or "radio" role."`,
225225
);
226226
});

src/matchers/to-be-checked.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function toBeChecked(this: jest.MatcherContext, element: ReactTestInstanc
1010

1111
if (!isHostSwitch(element) && !isSupportedAccessibilityElement(element)) {
1212
throw new ErrorWithStack(
13-
`toBeChecked() works only on "Switch" element or accessibility elements with "checkbox" or "radio" role.`,
13+
`toBeChecked() works only on "Switch" elements or accessibility elements with "checkbox" or "radio" role.`,
1414
toBeChecked,
1515
);
1616
}

0 commit comments

Comments
 (0)