Skip to content

Commit 15195b3

Browse files
committed
Upgrade other dependencies and fix unit tests
1 parent 23d669a commit 15195b3

File tree

3 files changed

+114
-113
lines changed

3 files changed

+114
-113
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"vuedraggable": "^2.24.1"
4848
},
4949
"devDependencies": {
50-
"@types/jest": "^26.0.14",
50+
"@types/jest": "^27.0.1",
5151
"@typescript-eslint/eslint-plugin": "^4.1.1",
5252
"@typescript-eslint/parser": "^4.1.1",
5353
"@vue/cli-plugin-babel": "^4.0.5",
@@ -61,9 +61,9 @@
6161
"babel-eslint": "^10.0.1",
6262
"eslint": "^7.9.0",
6363
"eslint-plugin-vue": "^7.1.0",
64-
"lint-staged": "^10.4.0",
64+
"lint-staged": "^11.1.2",
6565
"node-sass": "^6.0.1",
66-
"sass-loader": "^10.0.2",
66+
"sass-loader": "^12.1.0",
6767
"typescript": "^4.0.3",
6868
"vue-template-compiler": "^2.5.21",
6969
"vuepress": "^1.2.0"

tests/unit/drag-n-drop.spec.ts

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ describe('Test drag\'n\'drop related actions', () => {
151151
expect((app.emitted('input') as any)[0][0]).toStrictEqual(qbClone);
152152
});
153153

154-
it('tests drag\'n\'drop by merging with a parent group', async done => {
154+
it('tests drag\'n\'drop by merging with a parent group', done => {
155155
const app = mount(QueryBuilder, {
156156
propsData: {
157157
value,
@@ -204,15 +204,16 @@ describe('Test drag\'n\'drop related actions', () => {
204204
};
205205
adderComponent.findComponent(Draggable).vm.$emit('change', addEv);
206206

207-
await flushPromises();
207+
flushPromises()
208+
.then(() => {
209+
expect((parent.emitted('query-update') as any)[0][0]).toStrictEqual(qbClone);
210+
expect((app.emitted('input') as any)[0][0]).toStrictEqual(qbClone);
208211

209-
expect((parent.emitted('query-update') as any)[0][0]).toStrictEqual(qbClone);
210-
expect((app.emitted('input') as any)[0][0]).toStrictEqual(qbClone);
211-
212-
done();
212+
done();
213+
});
213214
});
214215

215-
it('tests drag\'n\'dropping with merging within the adding group', async done => {
216+
it('tests drag\'n\'dropping with merging within the adding group', done => {
216217
const app = mount(QueryBuilder, {
217218
propsData: {
218219
value,
@@ -263,15 +264,16 @@ describe('Test drag\'n\'drop related actions', () => {
263264
};
264265
adderComponent.findComponent(Draggable).vm.$emit('change', addEv);
265266

266-
await flushPromises();
267-
268-
expect((adderComponent.emitted('query-update') as any)[0][0]).toStrictEqual(adder);
269-
expect((app.emitted('input') as any)[0][0]).toStrictEqual(qbClone);
267+
flushPromises()
268+
.then(() => {
269+
expect((adderComponent.emitted('query-update') as any)[0][0]).toStrictEqual(adder);
270+
expect((app.emitted('input') as any)[0][0]).toStrictEqual(qbClone);
270271

271-
done();
272+
done();
273+
});
272274
});
273275

274-
it('tests drag\'n\'dropping with merging within the deleting group', async done => {
276+
it('tests drag\'n\'dropping with merging within the deleting group', done => {
275277
const app = mount(QueryBuilder, {
276278
propsData: {
277279
value,
@@ -322,11 +324,13 @@ describe('Test drag\'n\'drop related actions', () => {
322324
};
323325
adderComponent.findComponent(Draggable).vm.$emit('change', addEv);
324326

325-
await flushPromises();
326-
327-
expect((removerComponent.emitted('query-update') as any)[0][0]).toStrictEqual(remover);
328-
expect((app.emitted('input') as any)[0][0]).toStrictEqual(qbClone);
327+
// await flushPromises();
328+
flushPromises()
329+
.then(() => {
330+
expect((removerComponent.emitted('query-update') as any)[0][0]).toStrictEqual(remover);
331+
expect((app.emitted('input') as any)[0][0]).toStrictEqual(qbClone);
329332

330-
done();
333+
done();
334+
});
331335
});
332336
});

0 commit comments

Comments
 (0)