Closed
Description
Relevant code or config:
In the documentation at https://chrisnoring.gitbooks.io/react/content/testing/react-testing-library.html there is this example.
it('load data', async() => {
const {getByText, getByTestId, getByPlaceholderText, container} = render(<Select />);
Simulate.click(getByText('Load'));
await wait(() => getByTestId('data'))
const data = getByTestId('data')
const elem = getByTestId('item');
expect(elem).toHaveTextContent('test');
})
Problem description:
The variable data
is never used, so the line const data = getByTestId('data')
is unnecessary since it doesn't have any effect on the outcome of the test.
Suggested solution:
Remove the line const data = getByTestId('data')
Metadata
Metadata
Assignees
Labels
No labels