Skip to content

Commit

Permalink
fix: fix preview
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Dec 20, 2024
1 parent 1f12f7c commit d14bebc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/browser/src/client/tester/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export function createUserEvent(__tl_user_event_base__?: TestingLibraryUserEvent

function createPreviewUserEvent(userEventBase: TestingLibraryUserEvent, options: TestingLibraryOptions): UserEvent {
let userEvent = userEventBase.setup(options)
let clipboardData: any
let clipboardData: DataTransfer | undefined

function toElement(element: Element | Locator) {
return element instanceof Element ? element : element.element()
Expand Down Expand Up @@ -217,7 +217,7 @@ function createPreviewUserEvent(userEventBase: TestingLibraryUserEvent, options:
},

async copy() {
await userEvent.copy()
clipboardData = await userEvent.copy()
},
async cut() {
clipboardData = await userEvent.cut()
Expand Down
3 changes: 2 additions & 1 deletion test/browser/specs/runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ error with a stack
})

test('user-event', async () => {
const { stdout } = await runBrowserTests({
const { stdout, stderr } = await runBrowserTests({
root: './fixtures/user-event',
})
onTestFailed(() => console.error(stderr))
instances.forEach(({ browser }) => {
expect(stdout).toReportPassedTest('cleanup-retry.test.ts', browser)
expect(stdout).toReportPassedTest('cleanup1.test.ts', browser)
Expand Down

0 comments on commit d14bebc

Please sign in to comment.