2026-11-01 21:09:08 +00:00
|
|
|
import { cleanup } from '@testing-library/react';
|
|
|
|
|
import { afterEach } from 'vitest';
|
|
|
|
|
|
|
|
|
|
afterEach(cleanup);
|
2026-11-01 21:28:42 +00:00
|
|
|
|
|
|
|
|
// jsdom has `<dialog>` without its modal methods.
|
|
|
|
|
if (typeof HTMLDialogElement !== 'undefined') {
|
|
|
|
|
HTMLDialogElement.prototype.showModal ??= function showModal(
|
|
|
|
|
this: HTMLDialogElement,
|
|
|
|
|
) {
|
|
|
|
|
this.open = true;
|
|
|
|
|
};
|
|
|
|
|
HTMLDialogElement.prototype.close ??= function close(
|
|
|
|
|
this: HTMLDialogElement,
|
|
|
|
|
) {
|
|
|
|
|
this.open = false;
|
|
|
|
|
};
|
|
|
|
|
}
|