1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00
fab-manager/test/frontend/__lib__/tiptap.ts

17 lines
389 B
TypeScript
Raw Normal View History

2022-11-29 18:07:05 +01:00
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);
});
});
}
};