1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Chore: Mobile: Improve note screen tests and fix CI warning (#11126)

This commit is contained in:
Henry Heino
2024-09-27 07:23:02 -07:00
committed by GitHub
parent 90640e590e
commit 5935c9c147
8 changed files with 143 additions and 29 deletions

View File

@ -1,15 +1,7 @@
import { screen, waitFor } from '@testing-library/react-native';
import getWebViewWindowById from './getWebViewWindowById';
const getWebViewDomById = async (id: string): Promise<Document> => {
const webviewContent = await screen.findByTestId(id);
expect(webviewContent).toBeVisible();
await waitFor(() => {
expect(!!webviewContent.props.document).toBe(true);
});
// Return the composite ExtendedWebView component
// See https://callstack.github.io/react-native-testing-library/docs/advanced/testing-env#tree-navigation
return webviewContent.props.document;
return (await getWebViewWindowById(id)).document;
};
export default getWebViewDomById;