Skip to content

Commit

Permalink
initialIndex: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Johnson committed Apr 5, 2017
1 parent a7de094 commit af72422
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/lory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,26 @@ describe('lory()', function () {
});
});
});

describe('with initialIndex', function () {
beforeEach(function () {
instance = lory(element, {
initialIndex: 3
});
});

describe('called once', function() {
var expectedIndex = 2;

beforeEach(function () {
instance.prev();
});

it('index has to be 2 (one less than initialIndex)', function() {
assert.equal(instance.returnIndex(), expectedIndex);
});
});
});
});

describe('.destroy()', function () {
Expand Down

0 comments on commit af72422

Please sign in to comment.