diff options
Diffstat (limited to 'spec/frontend/issuable_form_spec.js')
-rw-r--r-- | spec/frontend/issuable_form_spec.js | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/spec/frontend/issuable_form_spec.js b/spec/frontend/issuable_form_spec.js index bc7a87eb65c..c77fde4261e 100644 --- a/spec/frontend/issuable_form_spec.js +++ b/spec/frontend/issuable_form_spec.js @@ -20,16 +20,13 @@ describe('IssuableForm', () => { describe('removeWip', () => { it.each` prefix - ${'drAft '} ${'draFT: '} ${' [DRaft] '} ${'drAft:'} ${'[draFT]'} - ${' dRaFt - '} - ${'dRaFt - '} ${'(draft) '} ${' (DrafT)'} - ${'draft draft - draft: [draft] (draft)'} + ${'draft: [draft] (draft)'} `('removes "$prefix" from the beginning of the title', ({ prefix }) => { instance.titleField.val(`${prefix}The Issuable's Title Value`); @@ -48,4 +45,18 @@ describe('IssuableForm', () => { expect(instance.titleField.val()).toBe("Draft: The Issuable's Title Value"); }); }); + + describe('workInProgress', () => { + it.each` + title | expected + ${'draFT: something is happening'} | ${true} + ${'draft something is happening'} | ${false} + ${'something is happening to drafts'} | ${false} + ${'something is happening'} | ${false} + `('returns $expected with "$title"', ({ title, expected }) => { + instance.titleField.val(title); + + expect(instance.workInProgress()).toBe(expected); + }); + }); }); |