Commit 04cee581 authored by Paul Slaughter's avatar Paul Slaughter

Add specs for issuable_form.workInProgress

This prevents issues where the regex could
match an empty string so the .test is true
but the .replace doesn't replace anything.
parent 09279da7
......@@ -45,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);
});
});
});
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