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

Commit 36d2b3d

Browse files
committed
Fix tests for latest React and Jest
1 parent ea6fd09 commit 36d2b3d

File tree

1 file changed

+25
-29
lines changed

1 file changed

+25
-29
lines changed

src/__tests__/ReactART-test.js

+25-29
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
"use strict";
1515

16-
require('mock-modules')
17-
.dontMock('ReactART');
16+
jest.dontMock('ReactART');
1817

1918
var React;
2019
var ReactTestUtils;
@@ -55,10 +54,7 @@ describe('ReactART', function() {
5554
ReactDOM = require('react-dom');
5655

5756
var ReactART = require('ReactART');
58-
var ARTSVGMode = require('art/modes/svg');
59-
var ARTCurrentMode = require('art/modes/current');
60-
61-
ARTCurrentMode.setCurrent(ARTSVGMode);
57+
ReactART.mode('svg');
6258

6359
Group = ReactART.Group;
6460
Shape = ReactART.Shape;
@@ -118,23 +114,23 @@ describe('ReactART', function() {
118114
instance = ReactTestUtils.renderIntoDocument(instance);
119115

120116
var expectedStructure = {
121-
nodeName: 'SVG',
117+
nodeName: 'svg',
122118
width: '150',
123119
height: '200',
124120
children: [
125-
{ nodeName: 'DEFS' },
121+
{ nodeName: 'defs' },
126122
{
127-
nodeName: 'G',
123+
nodeName: 'g',
128124
children: [
129125
{
130-
nodeName: 'DEFS',
126+
nodeName: 'defs',
131127
children: [
132-
{ nodeName: 'LINEARGRADIENT' }
128+
{ nodeName: 'linearGradient' }
133129
]
134130
},
135-
{ nodeName: 'PATH' },
136-
{ nodeName: 'PATH' },
137-
{ nodeName: 'G' }
131+
{ nodeName: 'path' },
132+
{ nodeName: 'path' },
133+
{ nodeName: 'g' }
138134
]
139135
}
140136
]
@@ -149,16 +145,16 @@ describe('ReactART', function() {
149145
var instance = ReactDOM.render(<TestComponent flipped={false} />, container);
150146

151147
var expectedStructure = {
152-
nodeName: 'SVG',
148+
nodeName: 'svg',
153149
children: [
154-
{ nodeName: 'DEFS' },
150+
{ nodeName: 'defs' },
155151
{
156-
nodeName: 'G',
152+
nodeName: 'g',
157153
children: [
158-
{ nodeName: 'DEFS' },
159-
{ nodeName: 'PATH', opacity: '0.1' },
160-
{ nodeName: 'PATH', opacity: Missing },
161-
{ nodeName: 'G' }
154+
{ nodeName: 'defs' },
155+
{ nodeName: 'path', opacity: '0.1' },
156+
{ nodeName: 'path', opacity: Missing },
157+
{ nodeName: 'g' }
162158
]
163159
}
164160
]
@@ -170,16 +166,16 @@ describe('ReactART', function() {
170166
ReactDOM.render(<TestComponent flipped={true} />, container);
171167

172168
var expectedNewStructure = {
173-
nodeName: 'SVG',
169+
nodeName: 'svg',
174170
children: [
175-
{ nodeName: 'DEFS' },
171+
{ nodeName: 'defs' },
176172
{
177-
nodeName: 'G',
173+
nodeName: 'g',
178174
children: [
179-
{ nodeName: 'DEFS' },
180-
{ nodeName: 'PATH', opacity: Missing },
181-
{ nodeName: 'PATH', opacity: '0.1' },
182-
{ nodeName: 'G' }
175+
{ nodeName: 'defs' },
176+
{ nodeName: 'path', opacity: Missing },
177+
{ nodeName: 'path', opacity: '0.1' },
178+
{ nodeName: 'g' }
183179
]
184180
}
185181
]
@@ -208,7 +204,7 @@ describe('ReactART', function() {
208204
expect(mounted).toBe(true);
209205
});
210206

211-
it('resolves refs before componentDidMount', function() {
207+
it('resolves refs bef ore componentDidMount', function() {
212208
var CustomShape = React.createClass({
213209
render: function() {
214210
return <Shape />;

0 commit comments

Comments
 (0)