fix: restore navigator.clipboard and execCommand mocks in tests

This commit is contained in:
Siddharth Kumar Sah
2026-04-04 16:28:43 +08:00
parent 19ce303123
commit 6b03a8b8bd
+5
View File
@@ -15,7 +15,12 @@ describe("generateId", () => {
});
describe("copyToClipboard", () => {
const originalClipboard = navigator.clipboard;
const originalExecCommand = document.execCommand;
afterEach(() => {
Object.assign(navigator, { clipboard: originalClipboard });
document.execCommand = originalExecCommand;
vi.restoreAllMocks();
});