import { fireEvent, screen } from '@testing-library/react' import React from 'react' import { expect } from 'vitest' export const Insight = { Portal({ data }: { data: any }) { return
{JSON.stringify(data)}
}, async verify(obj: any) { const result = await screen.findByTestId('result') const data = JSON.parse(result.innerText) expect(data).toMatchObject(obj) }, } export const Util = { find(id: string) { return screen.findByTestId(id) }, writeToField(node: HTMLInputElement, value: string) { fireEvent.change(node, { target: { value } }) }, }