Skip to content

Commit e4bf23d

Browse files
committed
rest messages
1 parent 1d17904 commit e4bf23d

13 files changed

Lines changed: 17 additions & 17 deletions

File tree

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

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

263263
expect(() => expect(checked).toBeChecked()).toThrowErrorMatchingInlineSnapshot(
264-
`"toBeChecked() works only on host "Switch" elements or accessibility elements with "checkbox", "radio" or "switch" role."`,
264+
`"toBeChecked() works only on host "Switch" instances or accessible instance with "checkbox", "radio" or "switch" role."`,
265265
);
266266
expect(() => expect(unchecked).not.toBeChecked()).toThrowErrorMatchingInlineSnapshot(
267-
`"toBeChecked() works only on host "Switch" elements or accessibility elements with "checkbox", "radio" or "switch" role."`,
267+
`"toBeChecked() works only on host "Switch" instances or accessible instance with "checkbox", "radio" or "switch" role."`,
268268
);
269269
});
270270

@@ -273,6 +273,6 @@ test('throws error for non-accessibility element', async () => {
273273

274274
const view = screen.getByTestId('test');
275275
expect(() => expect(view).toBeChecked()).toThrowErrorMatchingInlineSnapshot(
276-
`"toBeChecked() works only on host "Switch" elements or accessibility elements with "checkbox", "radio" or "switch" role."`,
276+
`"toBeChecked() works only on host "Switch" instances or accessible instance with "checkbox", "radio" or "switch" role."`,
277277
);
278278
});

src/matchers/__tests__/to-have-display-value.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ test("toHaveDisplayValue() on non-'TextInput' elements", async () => {
4949

5050
const view = screen.getByTestId('view');
5151
expect(() => expect(view).toHaveDisplayValue('test')).toThrowErrorMatchingInlineSnapshot(
52-
`"toHaveDisplayValue() works only with host "TextInput" elements. Passed instance has type "View"."`,
52+
`"toHaveDisplayValue() works only with host "TextInput" instances. Passed instance has type "View"."`,
5353
);
5454
});
5555

src/matchers/to-be-checked.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function toBeChecked(this: jest.MatcherContext, instance: TestInstance) {
1818

1919
if (!isHostSwitch(instance) && !isSupportedAccessibilityElement(instance)) {
2020
throw new ErrorWithStack(
21-
`toBeChecked() works only on host "Switch" elements or accessibility elements with "checkbox", "radio" or "switch" role.`,
21+
`toBeChecked() works only on host "Switch" instances or accessible instance with "checkbox", "radio" or "switch" role.`,
2222
toBeChecked,
2323
);
2424
}

src/matchers/to-have-display-value.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function toHaveDisplayValue(
1818

1919
if (!isHostTextInput(instance)) {
2020
throw new ErrorWithStack(
21-
`toHaveDisplayValue() works only with host "TextInput" elements. Passed instance has type "${instance.type}".`,
21+
`toHaveDisplayValue() works only with host "TextInput" instances. Passed instance has type "${instance.type}".`,
2222
toHaveDisplayValue,
2323
);
2424
}

src/user-event/__tests__/clear.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ describe('clear()', () => {
178178
await expect(
179179
user.clear(screen.getByTestId('input')),
180180
).rejects.toThrowErrorMatchingInlineSnapshot(
181-
`"clear() only supports host "TextInput" elements. Passed instance has type: "View"."`,
181+
`"clear() only supports host "TextInput" instances. Passed instance has type: "View"."`,
182182
);
183183
});
184184

src/user-event/__tests__/paste.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ describe('paste()', () => {
194194
await expect(
195195
user.paste(screen.getByTestId('input'), 'Hi!'),
196196
).rejects.toThrowErrorMatchingInlineSnapshot(
197-
`"paste() only supports host "TextInput" elements. Passed instance has type: "View"."`,
197+
`"paste() only supports host "TextInput" instances. Passed instance has type: "View"."`,
198198
);
199199
});
200200

src/user-event/clear.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { dispatchEvent, wait } from './utils';
1717
export async function clear(this: UserEventInstance, instance: TestInstance): Promise<void> {
1818
if (!isHostTextInput(instance)) {
1919
throw new ErrorWithStack(
20-
`clear() only supports host "TextInput" elements. Passed instance has type: "${instance.type}".`,
20+
`clear() only supports host "TextInput" instances. Passed instance has type: "${instance.type}".`,
2121
clear,
2222
);
2323
}

src/user-event/paste.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function paste(
2323
): Promise<void> {
2424
if (!isHostTextInput(instance)) {
2525
throw new ErrorWithStack(
26-
`paste() only supports host "TextInput" elements. Passed instance has type: "${instance.type}".`,
26+
`paste() only supports host "TextInput" instances. Passed instance has type: "${instance.type}".`,
2727
paste,
2828
);
2929
}

src/user-event/press/press.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface PressOptions {
2525

2626
export async function press(this: UserEventInstance, instance: TestInstance): Promise<void> {
2727
if (!isTestInstance(instance)) {
28-
throw new ErrorWithStack(`press() works only with host elements.`, press);
28+
throw new ErrorWithStack(`press() works only with host instances.`, press);
2929
}
3030

3131
await basePress(this.config, instance, {
@@ -39,7 +39,7 @@ export async function longPress(
3939
options?: PressOptions,
4040
): Promise<void> {
4141
if (!isTestInstance(instance)) {
42-
throw new ErrorWithStack(`longPress() works only with host elements.`, longPress);
42+
throw new ErrorWithStack(`longPress() works only with host instances.`, longPress);
4343
}
4444

4545
await basePress(this.config, instance, {
@@ -105,7 +105,7 @@ function hasPressEventHandler(instance: TestInstance) {
105105
}
106106

107107
/**
108-
* Dispatches a press event sequence for host elements that have `onPress*` event handlers.
108+
* Dispatches a press event sequence for host instances that have `onPress*` event handlers.
109109
*/
110110
async function emitDirectPressEvents(
111111
config: UserEventConfig,

src/user-event/scroll/__tests__/scroll-to.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ describe('scrollTo()', () => {
213213
await expect(
214214
user.scrollTo(screen.getByTestId('view'), { y: 20 }),
215215
).rejects.toThrowErrorMatchingInlineSnapshot(
216-
`"scrollTo() works only with host "ScrollView" elements. Passed instance has type "View"."`,
216+
`"scrollTo() works only with host "ScrollView" instances. Passed instance has type "View"."`,
217217
);
218218
});
219219

0 commit comments

Comments
 (0)