mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-13 23:48:55 +01:00
17 lines
389 B
TypeScript
17 lines
389 B
TypeScript
import { act, waitFor } from '@testing-library/react';
|
|
|
|
interface TipTapEvent {
|
|
type: (element: Element, content: string) => Promise<void>
|
|
}
|
|
|
|
export const tiptapEvent: TipTapEvent = {
|
|
type: async (element, content) => {
|
|
await act(async () => {
|
|
element.innerHTML = content;
|
|
await waitFor(() => {
|
|
expect(element.innerHTML).toBe(content);
|
|
});
|
|
});
|
|
}
|
|
};
|