Skip to content

Instantly share code, notes, and snippets.

@dennisja
Created November 18, 2018 18:35
Show Gist options
  • Save dennisja/55121251df10f31b2ad123f5e35db900 to your computer and use it in GitHub Desktop.
Save dennisja/55121251df10f31b2ad123f5e35db900 to your computer and use it in GitHub Desktop.
it('should render the loading component', () => {
const { getByText } = render(
// pass empty array to mocks prop
<MockedProvider mocks={[]}>
<UsersList />
</MockedProvider>
);
// find loading component by text
const loader = getByText(/Loading/);
// check whether that it renders the right content
expect(loader.textContent).toBe('Loading....');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment