Commit 38a08da5 authored by Himanshu Kapoor's avatar Himanshu Kapoor

Migrate ee/issuable specs to Jest

Migrate specs in ee/spec/javascripts/issuable to Jest
parent 16d431fc
...@@ -36,6 +36,11 @@ describe('AddIssuableForm', () => { ...@@ -36,6 +36,11 @@ describe('AddIssuableForm', () => {
let wrapper; let wrapper;
afterEach(() => { afterEach(() => {
// Jest doesn't blur an item even if it is destroyed,
// so blur the input manually after each test
const input = findFormInput(wrapper);
if (input) input.blur();
wrapper.destroy(); wrapper.destroy();
}); });
...@@ -178,7 +183,7 @@ describe('AddIssuableForm', () => { ...@@ -178,7 +183,7 @@ describe('AddIssuableForm', () => {
describe('when the form is submitted', () => { describe('when the form is submitted', () => {
it('emits an event with a "relates_to" link type when the "relates to" radio input selected', done => { it('emits an event with a "relates_to" link type when the "relates to" radio input selected', done => {
spyOn(wrapper.vm, '$emit'); jest.spyOn(wrapper.vm, '$emit').mockImplementation(() => {});
wrapper.vm.linkedIssueType = linkedIssueTypesMap.RELATES_TO; wrapper.vm.linkedIssueType = linkedIssueTypesMap.RELATES_TO;
wrapper.vm.onFormSubmit(); wrapper.vm.onFormSubmit();
...@@ -193,7 +198,7 @@ describe('AddIssuableForm', () => { ...@@ -193,7 +198,7 @@ describe('AddIssuableForm', () => {
}); });
it('emits an event with a "blocks" link type when the "blocks" radio input selected', done => { it('emits an event with a "blocks" link type when the "blocks" radio input selected', done => {
spyOn(wrapper.vm, '$emit'); jest.spyOn(wrapper.vm, '$emit').mockImplementation(() => {});
wrapper.vm.linkedIssueType = linkedIssueTypesMap.BLOCKS; wrapper.vm.linkedIssueType = linkedIssueTypesMap.BLOCKS;
wrapper.vm.onFormSubmit(); wrapper.vm.onFormSubmit();
...@@ -208,7 +213,7 @@ describe('AddIssuableForm', () => { ...@@ -208,7 +213,7 @@ describe('AddIssuableForm', () => {
}); });
it('emits an event with a "is_blocked_by" link type when the "is blocked by" radio input selected', done => { it('emits an event with a "is_blocked_by" link type when the "is blocked by" radio input selected', done => {
spyOn(wrapper.vm, '$emit'); jest.spyOn(wrapper.vm, '$emit').mockImplementation(() => {});
wrapper.vm.linkedIssueType = linkedIssueTypesMap.IS_BLOCKED_BY; wrapper.vm.linkedIssueType = linkedIssueTypesMap.IS_BLOCKED_BY;
wrapper.vm.onFormSubmit(); wrapper.vm.onFormSubmit();
......
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