Created
November 14, 2019 18:07
-
-
Save tcodes0/e0cbac57f9df4186dbe91d68c8d345cb to your computer and use it in GitHub Desktop.
testfile (relay RTL found router)
This file contains hidden or 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
| test.only('it works', async () => { | |
| const environment = createMockEnvironment(); | |
| const ComponentWithRouter = await mountWithRouter(LoginComponent, environment); | |
| const { getByPlaceholderText, queryByText, getByTestId } = render( | |
| <RelayEnvironmentProvider environment={environment}> | |
| <ThemeProvider theme={theme}>{ComponentWithRouter}</ThemeProvider> | |
| </RelayEnvironmentProvider>, | |
| ); | |
| // Inject some input into component | |
| environment.mock.resolve( | |
| operation, | |
| MockPayloadGenerator.generate(operation, { | |
| String: () => null, | |
| User: (context, id) => { | |
| return { | |
| id: id().toString(), | |
| name: 'tom', | |
| profileImage: { | |
| url: 'url@url.url', | |
| }, | |
| }; | |
| }, | |
| }), | |
| ); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment