Skip to content

Commit 5aeea86

Browse files
committed
test: add test for defaultIndex
1 parent ff7a626 commit 5aeea86

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/unit/Flicking.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,14 @@ describe("Flicking", () => {
205205

206206
expect(flicking.index).to.equal(0);
207207
});
208+
209+
it("should initialized with panel which has index equal to defaultIndex when panels are not visible.", async () => {
210+
const flicking = await createFlicking(El.DEFAULT_HORIZONTAL.setWidth(0), { defaultIndex: 1, autoInit: false });
211+
212+
await flicking.init();
213+
214+
expect(flicking.index).to.equal(1);
215+
});
208216
});
209217

210218
describe("horizontal", () => {

0 commit comments

Comments
 (0)