Skip to content

Commit 6b33c2e

Browse files
adding tests
1 parent 475a594 commit 6b33c2e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

tests/unit/vuedraggable.spec.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@ describe("draggable.vue when initialized with list", () => {
146146
}
147147
)
148148

149+
it("computes indexes", async () => {
150+
await Vue.nextTick();
151+
//To be altered
152+
expect(vm.visibleIndexes).toEqual([-1, 0, 1, 2, -1]);
153+
});
154+
155+
it("set realList", () => {
156+
expect(vm.realList).toEqual(["a", "b", "c"]);
157+
});
158+
149159
describe("when using component as tag", () => {
150160
beforeEach(() => {
151161
input = jest.fn();
@@ -560,12 +570,16 @@ describe("draggable.vue when initialized with value", () => {
560570
element = wrapper.element;
561571
});
562572

563-
it("computes indexes", async () =>{
573+
it("computes indexes", async () => {
564574
await Vue.nextTick();
565575
expect(vm.visibleIndexes).toEqual([0, 1, 2]);
566576
});
567577

568-
it("transition mode should be false", async () =>{
578+
it("set realList", () => {
579+
expect(vm.realList).toEqual(["a", "b", "c"]);
580+
});
581+
582+
it("transition mode should be false", () => {
569583
expect(vm.transitionMode).toBe(false);
570584
});
571585

0 commit comments

Comments
 (0)