Skip to content

Commit b0df521

Browse files
committed
Handle change in style formatting in tests
1 parent 5b54b5d commit b0df521

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

packages/material-ui/src/Slide/Slide.test.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { assert } from 'chai';
33
import { spy, stub, useFakeTimers } from 'sinon';
44
import { createMount, describeConformance } from '@material-ui/core/test-utils';
55
import Slide, { setTranslateValue } from './Slide';
6-
import transitions, { easing } from '../styles/transitions';
76
import createMuiTheme from '../styles/createMuiTheme';
87

98
describe('<Slide />', () => {
@@ -102,7 +101,7 @@ describe('<Slide />', () => {
102101

103102
describe('handleEntering()', () => {
104103
it('should reset the translate3d', () => {
105-
assert.strictEqual(handleEntering.args[0][0].style.transform, 'translate(0, 0)');
104+
assert.match(handleEntering.args[0][0].style.transform, /translate\(0(px)?, 0(px)?\)/);
106105
});
107106

108107
it('should call handleEntering', () => {
@@ -171,20 +170,18 @@ describe('<Slide />', () => {
171170
});
172171

173172
it('should create proper easeOut animation onEntering', () => {
174-
const animation = transitions.create('transform', {
175-
duration: enterDuration,
176-
easing: easing.easeOut,
177-
});
178-
assert.strictEqual(handleEntering.args[0][0].style.transition, animation);
173+
assert.match(
174+
handleEntering.args[0][0].style.transition,
175+
/transform 556ms cubic-bezier\(0(.0)?, 0, 0.2, 1\)( 0ms)?/,
176+
);
179177
});
180178

181179
it('should create proper sharp animation onExit', () => {
182180
wrapper.setProps({ in: false });
183-
const animation = transitions.create('transform', {
184-
duration: leaveDuration,
185-
easing: easing.sharp,
186-
});
187-
assert.strictEqual(handleExit.args[0][0].style.transition, animation);
181+
assert.match(
182+
handleExit.args[0][0].style.transition,
183+
/transform 446ms cubic-bezier\(0.4, 0, 0.6, 1\)( 0ms)?/,
184+
);
188185
});
189186
});
190187

0 commit comments

Comments
 (0)