1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00
Files
joplin/packages/app-mobile/utils/testing/getWebViewWindowById.ts
2025-07-29 20:25:43 +01:00

16 lines
435 B
TypeScript

import { screen, waitFor } from './testingLibrary';
const getWebViewWindowById = async (id: string): Promise<Window & typeof globalThis> => {
const webviewContent = await screen.findByTestId(id);
expect(webviewContent).toBeVisible();
await waitFor(() => {
expect(!!webviewContent.props.window).toBe(true);
});
const webviewWindow = webviewContent.props.window;
return webviewWindow;
};
export default getWebViewWindowById;