Skip to content

Commit a294925

Browse files
Merge pull request #1029 from nextcloud/dependabot/npm_and_yarn/happy-dom-12.10.3
2 parents 0988e51 + 0706782 commit a294925

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@vue/test-utils": "^1.3.6",
2121
"@vue/tsconfig": "^0.4.0",
2222
"eslint-plugin-chai-friendly": "^0.7.2",
23-
"happy-dom": "^10.11.0",
23+
"happy-dom": "^12.10.3",
2424
"typescript": "^5.2.2",
2525
"vite": "^4.4.11",
2626
"vitest": "^0.34.6"

src/utils/clipboard.spec.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,11 @@ import { expect, describe, it, vi, beforeAll } from 'vitest'
66
import { copyToCipboard } from './clipboard'
77

88
describe('utils:clipboard', () => {
9-
beforeAll(() => {
10-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
11-
// @ts-ignore
12-
window.navigator.clipboard = {
13-
writeText: vi.fn(() => Promise.resolve()),
14-
}
15-
})
16-
179
it('writes to clipboard', () => {
10+
const spy = vi.spyOn(window.navigator.clipboard, 'writeText')
1811
const prompt = vi.spyOn(window, 'prompt').mockImplementation(() => '')
1912
copyToCipboard('foo bar')
20-
expect(window.navigator.clipboard.writeText).toBeCalledWith('foo bar')
13+
expect(spy).toBeCalledWith('foo bar')
2114
expect(prompt).not.toBeCalled()
2215
})
2316

0 commit comments

Comments
 (0)