From 9f9c9989c5d8240bee66ce6cd282f8f546c8f52a Mon Sep 17 00:00:00 2001
From: joshwooding <12938082+joshwooding@users.noreply.github.com>
Date: Sun, 14 Apr 2019 14:31:29 +0100
Subject: [PATCH] Handle change in style formatting in tests
---
packages/material-ui/src/Slide/Slide.test.js | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/packages/material-ui/src/Slide/Slide.test.js b/packages/material-ui/src/Slide/Slide.test.js
index 431d7c3238ecae..7ad30099a86d40 100644
--- a/packages/material-ui/src/Slide/Slide.test.js
+++ b/packages/material-ui/src/Slide/Slide.test.js
@@ -3,7 +3,6 @@ import { assert } from 'chai';
import { spy, stub, useFakeTimers } from 'sinon';
import { createMount, describeConformance } from '@material-ui/core/test-utils';
import Slide, { setTranslateValue } from './Slide';
-import transitions, { easing } from '../styles/transitions';
import createMuiTheme from '../styles/createMuiTheme';
describe('', () => {
@@ -102,7 +101,7 @@ describe('', () => {
describe('handleEntering()', () => {
it('should reset the translate3d', () => {
- assert.strictEqual(handleEntering.args[0][0].style.transform, 'translate(0, 0)');
+ assert.match(handleEntering.args[0][0].style.transform, /translate\(0(px)?, 0(px)?\)/);
});
it('should call handleEntering', () => {
@@ -171,20 +170,15 @@ describe('', () => {
});
it('should create proper easeOut animation onEntering', () => {
- const animation = transitions.create('transform', {
- duration: enterDuration,
- easing: easing.easeOut,
- });
- assert.strictEqual(handleEntering.args[0][0].style.transition, animation);
+ assert.match(
+ handleEntering.args[0][0].style.transition,
+ /transform 556ms cubic-bezier\(0(.0)?, 0, 0.2, 1\) 0ms/,
+ );
});
it('should create proper sharp animation onExit', () => {
wrapper.setProps({ in: false });
- const animation = transitions.create('transform', {
- duration: leaveDuration,
- easing: easing.sharp,
- });
- assert.strictEqual(handleExit.args[0][0].style.transition, animation);
+ assert.match(handleExit.args[0][0].style.transition, /transform 446ms cubic-bezier\(0.4, 0, 0.6, 1\)( 0ms)?/);
});
});