Skip to content

Commit b7b5501

Browse files
Refactoring tests
1 parent 8446825 commit b7b5501

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

tests/unit/vuedraggable.integrated.spec.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,20 @@ describe.each([
3333
[DraggableWithTransition, "draggable with transition", expectedDomTransition]
3434
])
3535
(
36-
"should update list with component: %s %s",
36+
"should update list and DOM with component: %s %s",
3737
(component, _, expectedDom) => {
3838

39-
beforeEach(() => {
40-
jest.resetAllMocks();
41-
wrapper = mount(component, {
42-
attachToDocument: true
43-
});
44-
vm = wrapper.vm;
45-
element = wrapper.find('span').element;
46-
});
47-
4839
describe("when handling sort", () => {
49-
let item;
5040

5141
beforeEach(async () => {
52-
item = element.children[2];
42+
jest.resetAllMocks();
43+
wrapper = mount(component, {
44+
attachToDocument: true
45+
});
46+
vm = wrapper.vm;
47+
element = wrapper.find('span').element;
48+
49+
const item = element.children[2];
5350
const startEvt = { item };
5451
getEvent("onStart")(startEvt);
5552
await Vue.nextTick();
@@ -64,7 +61,7 @@ describe.each([
6461
from: element
6562
});
6663
await Vue.nextTick();
67-
})
64+
});
6865

6966
it("sends a change event", async () => {
7067
const draggableWrapper = wrapper.find(draggable);

0 commit comments

Comments
 (0)