Skip to content

Commit 9d55fa3

Browse files
committed
Use testing-library instead of enzyme for tests
1 parent 840e27b commit 9d55fa3

13 files changed

+1039
-1076
lines changed

client/components/__test__/FileNode.test.jsx

Lines changed: 0 additions & 183 deletions
This file was deleted.

client/components/__test__/Nav.test.jsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
import React from 'react';
3-
import { shallow } from 'enzyme';
4-
import renderer from 'react-test-renderer';
3+
import { render } from '@testing-library/react';
54

6-
import { NavComponent } from './../Nav';
5+
6+
import { NavComponent } from '../Nav';
77

88
describe('Nav', () => {
99
const props = {
@@ -46,17 +46,9 @@ describe('Nav', () => {
4646
id: 'root-file'
4747
}
4848
};
49-
const getWrapper = () => shallow(<NavComponent {...props} />);
50-
51-
test('it renders main navigation', () => {
52-
const nav = getWrapper();
53-
expect(nav.exists('.nav')).toEqual(true);
54-
});
5549

5650
it('renders correctly', () => {
57-
const tree = renderer
58-
.create(<NavComponent {...props} />)
59-
.toJSON();
60-
expect(tree).toMatchSnapshot();
51+
const { asFragment } = render(<NavComponent {...props} />);
52+
expect(asFragment()).toMatchSnapshot();
6153
});
6254
});

client/components/__test__/Toolbar.test.jsx

Lines changed: 0 additions & 105 deletions
This file was deleted.

0 commit comments

Comments
 (0)