Skip to content

Use React Testing Library instead of Enzyme for tests #1477

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

Merged
merged 4 commits into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 0 additions & 183 deletions client/components/__test__/FileNode.test.jsx

This file was deleted.

18 changes: 5 additions & 13 deletions client/components/__test__/Nav.test.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

import React from 'react';
import { shallow } from 'enzyme';
import renderer from 'react-test-renderer';
import { render } from '@testing-library/react';

import { NavComponent } from './../Nav';

import { NavComponent } from '../Nav';

describe('Nav', () => {
const props = {
Expand Down Expand Up @@ -47,17 +47,9 @@ describe('Nav', () => {
},
t: jest.fn()
};
const getWrapper = () => shallow(<NavComponent {...props} />);

test('it renders main navigation', () => {
const nav = getWrapper();
expect(nav.exists('.nav')).toEqual(true);
});

it('renders correctly', () => {
const tree = renderer
.create(<NavComponent {...props} />)
.toJSON();
expect(tree).toMatchSnapshot();
const { asFragment } = render(<NavComponent {...props} />);
expect(asFragment()).toMatchSnapshot();
});
});
105 changes: 0 additions & 105 deletions client/components/__test__/Toolbar.test.jsx

This file was deleted.

Loading