Created
April 30, 2019 19:43
-
-
Save the-teacher/50dbf1f7aaf7367e7179bab3d7efd26f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import 'jest-dom/extend-expect' | |
import { render, cleanup } from 'react-testing-library' | |
import TestingRouter from './TestingRouter' | |
import Task from './Task' | |
afterEach(cleanup) | |
describe('Check that redirection works', () => { | |
it('has to redirect', () => { | |
const redirectUrl = '/tasks' | |
const data = { status: 'closed' } | |
const { container } = render( | |
<TestingRouter | |
ComponentWithRedirection={() => <Task data={data} />} | |
RedirectUrl={redirectUrl} | |
/> | |
) | |
expect(container.innerHTML).toEqual( | |
expect.stringContaining(redirectUrl) | |
) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment