Skip to content

Commit

Permalink
test(animation): Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaiklor committed Mar 28, 2016
1 parent 2daf3a4 commit acbe444
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/unit/Slide.test.js
Original file line number Diff line number Diff line change
@@ -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'});
Expand All @@ -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});
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit acbe444

Please sign in to comment.