Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add @testing-library/react-native #5197

Merged
merged 16 commits into from
Aug 3, 2021
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ import { VanityURLPossibleRedirect } from "../VanityURLPossibleRedirect"

beforeEach(() => {
__globalStoreTestUtils__?.setProductionMode()
fetchMock.mockReset()
fetchMock.resetMocks()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Know this one well 😄

})

describe(VanityURLPossibleRedirect, () => {
it("shows a loading spinner before anything has happened", () => {
it("shows a loading spinner before anything has happened", async () => {
fetchMockResponseOnce({
status: 200,
url: "https://artsy.net/test",
})

const tree = renderWithWrappers(<VanityURLPossibleRedirect slug="test" />)
expect(tree.root.findAllByType(Spinner)).toHaveLength(1)
await flushPromiseQueue()
})

it("sends a fetch request", async () => {
Expand Down