mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: restore navigator.clipboard and execCommand mocks in tests
This commit is contained in:
@@ -15,7 +15,12 @@ describe("generateId", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("copyToClipboard", () => {
|
describe("copyToClipboard", () => {
|
||||||
|
const originalClipboard = navigator.clipboard;
|
||||||
|
const originalExecCommand = document.execCommand;
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
Object.assign(navigator, { clipboard: originalClipboard });
|
||||||
|
document.execCommand = originalExecCommand;
|
||||||
vi.restoreAllMocks();
|
vi.restoreAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user