eigen
eigen copied to clipboard
refactor(tests): running automatic step to convert tests to new form, manual steps to come
This PR resolves []
Description
Automated/Find-and-Replace
- [x] remove all
jest.unmock("react-relay") - [x] replace every
defaultEnvironmentwithgetRelayEnvironment() - [ ] replace every
mockEnvironment.mockwithgetMockRelayEnvironment().mock - [x] remove all code like
let mockEnvironment: ReturnType<typeof createMockEnvironment> - [x] remove all code blocks like:
beforeEach(() => {
mockEnvironment = createMockEnvironment()
})
- [x] replace all code blocks like (to remove the env arg):
resolveMostRecentRelayOperation(mockEnvironment, {
FilterArtworksConnection: () => ({
counts: {
followedArtists: 0,
total: 0,
},
edges: [],
}),
})
with
resolveMostRecentRelayOperation( {
FilterArtworksConnection: () => ({
counts: {
followedArtists: 0,
total: 0,
},
edges: [],
}),
})
- [ ] replace all code blocks like:
env.mock.resolveMostRecentOperation((operation) =>
MockPayloadGenerator.generate(operation, {
Me: () => ({
name: "wow",
}),
})
)
with
resolveMostRecentRelayOperation({
Me: () => ({
name: "wow",
}),
})
- [x] replace
renderWithHookWrappersTLwithrenderWithRelayWrappers
Manual
-
if possible, change the tests to the new suggested way in EXAMPLES.md, using async, render, resolve, await wait, expects.
-
if you have issues with making the tests run, check the current main branch, in case some of the above actions failed
QA Test Case(s)
| Test Case | Feature | Environment | Acceptance Criteria | Setup Instructions/Link |
|---|---|---|---|---|
PR Checklist
- [ ] I tested my changes on iOS / Android.
- [ ] I added screenshots or videos to illustrate my changes.
- [ ] I added Tests and Stories for my changes.
- [ ] I added an app state migration.
- [ ] I hid my changes behind a feature flag.
To the reviewers 👀
- [ ] I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.