Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('remove related issue and succeeds', () => {
mock.onDelete(issuable1.referencePath).reply(200, { issues: [] });
wrapper.vm.onRelatedIssueRemoveRequest(issuable1.id);
return axios.waitForAll().then(() => {
expect(wrapper.vm.state.relatedIssues).toEqual([]);
});
});
it('issuableType is issue', () => {
wrapper = shallowMount(RelatedIssuesList, {
propsData: {
pathIdSeparator: PathIdSeparator.Issue,
issuableType: 'epic',
},
});
expect(wrapper.vm.issuableOrderingId(issuable1)).toBe(issuable1.id);
});
});
return waitForPromises().then(() => {
expect(wrapper.vm.state.pendingReferences).toHaveLength(0);
expect(wrapper.vm.state.relatedIssues).toHaveLength(1);
expect(wrapper.vm.state.relatedIssues[0].id).toEqual(issuable1.id);
});
});