Skip to content

Commit 0a609b2

Browse files
Improving tests
1 parent 0a4cdeb commit 0a609b2

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/vuedraggable.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ const draggableComponent = {
162162
return h(this.getTag(), attributes, children);
163163
},
164164

165+
renderError (h, err) {
166+
return h('pre', { style: { color: 'red' }}, err.stack)
167+
},
168+
165169
created() {
166170
if (this.list !== null && this.value !== null) {
167171
console.error(

tests/unit/vuedraggable.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,12 @@ describe("draggable.vue when initialized with a transition group", () => {
760760
expect(wrapper.html()).toEqual(initialRenderTransition);
761761
})
762762

763+
it("creates sortable instance with options on transition root", () => {
764+
expect(Sortable.mock.calls.length).toBe(1);
765+
const parameters = Sortable.mock.calls[0];
766+
expect(parameters[0]).toBe(element.children[0]);
767+
})
768+
763769
describe("when initiating a drag operation", () => {
764770
let evt;
765771
beforeEach(() => {

0 commit comments

Comments
 (0)