Skip to content

Commit

Permalink
test: add test for defaultIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
malangfox committed Dec 6, 2024
1 parent ff7a626 commit 5aeea86
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/unit/Flicking.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ describe("Flicking", () => {

expect(flicking.index).to.equal(0);
});

it("should initialized with panel which has index equal to defaultIndex when panels are not visible.", async () => {
const flicking = await createFlicking(El.DEFAULT_HORIZONTAL.setWidth(0), { defaultIndex: 1, autoInit: false });

await flicking.init();

expect(flicking.index).to.equal(1);
});
});

describe("horizontal", () => {
Expand Down

0 comments on commit 5aeea86

Please sign in to comment.