Commit 341cc363 authored by Mark Florian's avatar Mark Florian

Make test pass for the right reason

Previously, the `nextTick` wasn't awaited, which meant that the on-call
schedules list wasn't rendered anyway.

This also makes sure the previous wrapper is destroyed before creating
a new one for this test.
parent 2bb00a5c
...@@ -99,10 +99,14 @@ describe('LeaveModal', () => { ...@@ -99,10 +99,14 @@ describe('LeaveModal', () => {
}); });
}); });
it("does NOT display oncall schedules list when member's user is NOT a part of on-call schedules ", () => { it("does NOT display oncall schedules list when member's user is NOT a part of on-call schedules ", async () => {
wrapper.destroy();
const memberWithoutOncallSchedules = cloneDeep(member); const memberWithoutOncallSchedules = cloneDeep(member);
delete memberWithoutOncallSchedules.user.oncallSchedules; delete memberWithoutOncallSchedules.user.oncallSchedules;
createComponent({ member: memberWithoutOncallSchedules }); createComponent({ member: memberWithoutOncallSchedules });
await nextTick();
expect(findOncallSchedulesList().exists()).toBe(false); expect(findOncallSchedulesList().exists()).toBe(false);
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment