mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-14 11:33:51 +00:00
Move shlink-web-component tests to their own folder
This commit is contained in:
18
shlink-web-component/test/__mocks__/Window.mock.ts
Normal file
18
shlink-web-component/test/__mocks__/Window.mock.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { fromAny, fromPartial } from '@total-typescript/shoehorn';
|
||||
|
||||
const createLinkMock = () => ({
|
||||
setAttribute: vi.fn(),
|
||||
click: vi.fn(),
|
||||
style: {},
|
||||
});
|
||||
|
||||
export const appendChild = vi.fn();
|
||||
|
||||
export const removeChild = vi.fn();
|
||||
|
||||
export const windowMock = fromPartial<Window>({
|
||||
document: fromAny({
|
||||
createElement: vi.fn(createLinkMock),
|
||||
body: { appendChild, removeChild },
|
||||
}),
|
||||
});
|
||||
Reference in New Issue
Block a user