diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2019-05-06 23:04:59 +0300 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2019-05-08 00:32:53 +0300 |
commit | 4ce36f3443a3385468fd6fde0ae9f27d54ea1d37 (patch) | |
tree | d278526092c7c0ab1f68d9b3b088e17d945200c5 /spec/frontend/notes | |
parent | bc753559860935687f5eb285c8def2a178a673d7 (diff) |
Add failing test for hasQuickActions
Diffstat (limited to 'spec/frontend/notes')
-rw-r--r-- | spec/frontend/notes/stores/utils_spec.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/frontend/notes/stores/utils_spec.js b/spec/frontend/notes/stores/utils_spec.js new file mode 100644 index 00000000000..b31b7491334 --- /dev/null +++ b/spec/frontend/notes/stores/utils_spec.js @@ -0,0 +1,17 @@ +import { hasQuickActions } from '~/notes/stores/utils'; + +describe('hasQuickActions', () => { + it.each` + input | expected + ${'some comment'} | ${false} + ${'/quickaction'} | ${true} + ${'some comment with\n/quickaction'} | ${true} + `('returns $expected for $input', ({ input, expected }) => { + expect(hasQuickActions(input)).toBe(expected); + }); + + it('is stateless', () => { + expect(hasQuickActions('some comment')).toBe(hasQuickActions('some comment')); + expect(hasQuickActions('/quickaction')).toBe(hasQuickActions('/quickaction')); + }); +}); |