Skip to content

Commit fa55fff

Browse files
committed
fix: fix reactive tests
1 parent 4854086 commit fa55fff

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/unit/reactive/reactive.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from "chai";
22
import Flicking from "~/Flicking";
3-
import { connectFlickingReactiveAPI } from "~/reactive";
3+
import { connectFlickingReactiveAPI, FlickingReactiveObject } from "~/reactive";
44
import {
55
cleanup,
66
createFlicking,
@@ -12,7 +12,7 @@ import El from "../helper/El";
1212
describe("Reactive API", () => {
1313
let container: HTMLElement;
1414
let flicking: Flicking;
15-
let stateApi: ReturnType<typeof connectFlickingReactiveAPI>;
15+
let stateApi: FlickingReactiveObject;
1616

1717
beforeEach(async () => {
1818
container = createSandbox("reactive-test");
@@ -32,6 +32,7 @@ describe("Reactive API", () => {
3232
expect(stateApi.totalPanelCount).to.equal(3);
3333
expect(stateApi.currentPanelIndex).to.equal(0);
3434
expect(stateApi.progress).to.equal(0);
35+
expect(stateApi.indexProgress).to.equal(0);
3536
});
3637
});
3738

@@ -44,6 +45,7 @@ describe("Reactive API", () => {
4445
expect(stateApi.isReachStart).to.be.false;
4546
expect(stateApi.isReachEnd).to.be.false;
4647
expect(stateApi.currentPanelIndex).to.equal(1);
48+
expect(stateApi.indexProgress).to.equal(1);
4749
expect(stateApi.progress).to.equal(50);
4850
});
4951

@@ -55,6 +57,7 @@ describe("Reactive API", () => {
5557
expect(stateApi.isReachStart).to.be.false;
5658
expect(stateApi.isReachEnd).to.be.true;
5759
expect(stateApi.currentPanelIndex).to.equal(2);
60+
expect(stateApi.indexProgress).to.equal(2);
5861
expect(stateApi.progress).to.equal(100);
5962
});
6063

@@ -80,6 +83,7 @@ describe("Reactive API", () => {
8083
await promise;
8184

8285
expect(stateApi.currentPanelIndex).to.equal(1);
86+
expect(stateApi.indexProgress).to.equal(1);
8387
expect(stateApi.progress).to.equal(50);
8488
});
8589
});

0 commit comments

Comments
 (0)