Skip to content

Instantly share code, notes, and snippets.

@janhesters
Created September 26, 2020 12:39
Show Gist options
  • Save janhesters/9d3ce02796bab4b398c03bf2a7ec50ad to your computer and use it in GitHub Desktop.
Save janhesters/9d3ce02796bab4b398c03bf2a7ec50ad to your computer and use it in GitHub Desktop.
Home page container tests.
import { fireEvent, render } from '@testing-library/react';
import { describe } from 'riteway';
import HomePage from './home-page-container.js';
describe('HomePage container', async assert => {
const { getByText, getByTestId } = render(<HomePage />);
fireEvent.click(getByText(/increment/i));
assert({
given: "a click on the 'Increment' button",
should: 'increment the count',
actual: getByTestId('count').textContent,
expected: '1',
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment