import { cleanup } from '@testing-library/react'; import { afterEach } from 'vitest'; afterEach(cleanup); // jsdom has `` 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; }; }