Skip to content

Commit 06792b6

Browse files
committed
use correct matcher for error
1 parent 9a54604 commit 06792b6

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

tests/clipboard/copy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ describe('without Clipboard API', () => {
8484

8585
await expect(
8686
userEvent.copy({writeToClipboard: true}),
87-
).rejects.toMatchInlineSnapshot(
88-
`[Error: The Clipboard API is unavailable.]`,
87+
).rejects.toThrowErrorMatchingInlineSnapshot(
88+
`The Clipboard API is unavailable.`,
8989
)
9090
})
9191

tests/clipboard/cut.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ describe('without Clipboard API', () => {
9292

9393
await expect(
9494
userEvent.cut({writeToClipboard: true}),
95-
).rejects.toMatchInlineSnapshot(
96-
`[Error: The Clipboard API is unavailable.]`,
95+
).rejects.toThrowErrorMatchingInlineSnapshot(
96+
`The Clipboard API is unavailable.`,
9797
)
9898
})
9999

tests/clipboard/paste.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ describe('without Clipboard API', () => {
143143
test('reject if trying to use missing API', async () => {
144144
const {getEvents} = render(`<input/>`)
145145

146-
await expect(userEvent.paste()).rejects.toMatchInlineSnapshot(
147-
`[Error: \`userEvent.paste()\` without \`clipboardData\` requires the \`ClipboardAPI\` to be available.]`,
146+
await expect(userEvent.paste()).rejects.toThrowErrorMatchingInlineSnapshot(
147+
`\`userEvent.paste()\` without \`clipboardData\` requires the \`ClipboardAPI\` to be available.`,
148148
)
149149
expect(getEvents()).toHaveLength(0)
150150
})

0 commit comments

Comments
 (0)