Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit 5e4eb44

Browse files
committed
Enzyme's shallow rendering is used instead of "react-test-renderer". Existing snapshots are updated.
1 parent fb15e54 commit 5e4eb44

File tree

4 files changed

+1317
-172
lines changed

4 files changed

+1317
-172
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
"react": "^16.2.0",
7575
"react-dom": "^16.2.0",
7676
"react-hot-loader": "^3.1.3",
77-
"react-test-renderer": "16.7.0",
7877
"style-loader": "^0.19.1",
7978
"webpack": "^3.10.0",
8079
"webpack-dev-server": "^2.9.7",

src/components/DefinedRange.test.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import React from 'react';
2-
import { mount } from 'enzyme';
2+
import { mount, shallow } from 'enzyme';
33

44
import DefinedRange from './DefinedRange';
55
import { isSameDay } from 'date-fns';
6-
import testRenderer from 'react-test-renderer';
76

87
describe('DefinedRange tests', () => {
98
test('Should call "renderStaticRangeLabel" callback correct amount of times according to the "hasCustomRendering" option', () => {
@@ -76,8 +75,7 @@ describe('DefinedRange tests', () => {
7675
return result;
7776
};
7877

79-
const tree = testRenderer
80-
.create(
78+
const wrapper = shallow(
8179
<DefinedRange
8280
staticRanges={[
8381
{
@@ -130,9 +128,8 @@ describe('DefinedRange tests', () => {
130128
]}
131129
renderStaticRangeLabel={renderStaticRangeLabel}
132130
/>
133-
)
134-
.toJSON();
131+
);
135132

136-
expect(tree).toMatchSnapshot();
133+
expect(wrapper).toMatchSnapshot();
137134
});
138135
});

0 commit comments

Comments
 (0)