Files
cunningham/packages/react/src/tests/HTMLDialogElementMock.ts

18 lines
342 B
TypeScript
Raw Normal View History

HTMLDialogElement.prototype.show = vi.fn(function mock(
this: HTMLDialogElement,
) {
this.open = true;
});
HTMLDialogElement.prototype.showModal = vi.fn(function mock(
this: HTMLDialogElement,
) {
this.open = true;
});
HTMLDialogElement.prototype.close = vi.fn(function mock(
this: HTMLDialogElement,
) {
this.open = false;
});