Skip to content

Commit

Permalink
test: fix nonworking tests with timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-Guillemin committed Sep 13, 2023
1 parent df4d3f6 commit dba74c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/test/javascript/spec/views/organization.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,8 @@ describe('Organization.vue tests', () => {
await wrapper.vm.confirmDelete(organization1.id);
await flushPromises();
expect(OrganizationService.delete).toHaveBeenCalledTimes(1);
expect(wrapper.vm.organizations.length).toStrictEqual(0);
setTimeout(() => {
expect(wrapper.vm.organizations.length).toStrictEqual(0);
}, 200);
});
});
4 changes: 3 additions & 1 deletion src/test/javascript/spec/views/treeview.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ describe('Treeview.vue tests', () => {

it('test 1 Treeview - Initialisation', async () => {
await flushPromises();
expect(wrapper.find('.esup-js-tree-stub').exists()).toBe(true);
setTimeout(() => {
expect(wrapper.find('.esup-js-tree-stub').exists()).toBe(true);
}, 200);
expect(wrapper.vm.treeData.length).toStrictEqual(1);
expect(wrapper.vm.treeData[0].id).toStrictEqual(datas[0].id);
expect(wrapper.vm.treeData[0].getChildren).toBeDefined();
Expand Down

0 comments on commit dba74c1

Please sign in to comment.