From acbe4443626e14037ec10fcb1a69bccbc10088e7 Mon Sep 17 00:00:00 2001 From: ghaiklor Date: Mon, 28 Mar 2016 17:19:57 +0300 Subject: [PATCH] test(animation): Fix tests --- test/unit/Slide.test.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/unit/Slide.test.js b/test/unit/Slide.test.js index adc693a..6bc0705 100644 --- a/test/unit/Slide.test.js +++ b/test/unit/Slide.test.js @@ -1,8 +1,11 @@ -import { assert } from 'chai'; +import {assert} from 'chai'; import sinon from 'sinon'; +import Cursor from 'kittik-cursor'; import Rectangle from 'kittik-shape-rectangle'; import Slide from '../../src/Slide'; +const cursor = Cursor.create(); + describe('Animation::Slide', () => { it('Should properly get/set direction', () => { const animation = new Slide({direction: 'inLeft'}); @@ -18,7 +21,7 @@ describe('Animation::Slide', () => { it('Should properly parse coordinates for shape based on direction', () => { const animation = new Slide(); - const shape = new Rectangle(); + const shape = new Rectangle(cursor); assert.instanceOf(animation.setDirection('inUp'), Slide); assert.deepEqual(animation._parseCoordinates(shape), {startX: 10, startY: -5, endX: 10, endY: 10}); @@ -67,7 +70,7 @@ describe('Animation::Slide', () => { it('Should properly call the animate() method', done => { const animation = new Slide(); - const shape = new Rectangle(); + const shape = new Rectangle(cursor); const mock = sinon.mock(animation); mock.expects('animateProperty').twice().returns(Promise.resolve());