summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2019-05-06 22:04:59 +0200
committerWinnie Hellmann <winnie@gitlab.com>2019-05-07 23:32:53 +0200
commit4ce36f3443a3385468fd6fde0ae9f27d54ea1d37 (patch)
treed278526092c7c0ab1f68d9b3b088e17d945200c5
parentbc753559860935687f5eb285c8def2a178a673d7 (diff)
downloadgitlab-ce-4ce36f3443a3385468fd6fde0ae9f27d54ea1d37.tar.gz
Add failing test for hasQuickActions
-rw-r--r--spec/frontend/notes/stores/utils_spec.js17
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'));
+ });
+});