-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: Mobile: Improve note screen tests and fix CI warning (#11126)
- Loading branch information
1 parent
90640e5
commit 5935c9c
Showing
8 changed files
with
143 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,7 @@ | ||
import { screen, waitFor } from '@testing-library/react-native'; | ||
const getWebViewDomById = async (id: string): Promise<Document> => { | ||
const webviewContent = await screen.findByTestId(id); | ||
expect(webviewContent).toBeVisible(); | ||
|
||
await waitFor(() => { | ||
expect(!!webviewContent.props.document).toBe(true); | ||
}); | ||
import getWebViewWindowById from './getWebViewWindowById'; | ||
|
||
// Return the composite ExtendedWebView component | ||
// See https://callstack.github.io/react-native-testing-library/docs/advanced/testing-env#tree-navigation | ||
return webviewContent.props.document; | ||
const getWebViewDomById = async (id: string): Promise<Document> => { | ||
return (await getWebViewWindowById(id)).document; | ||
}; | ||
|
||
export default getWebViewDomById; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { screen, waitFor } from '@testing-library/react-native'; | ||
|
||
const getWebViewWindowById = async (id: string): Promise<Window> => { | ||
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters