Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2019-05-06 23:04:59 +0300
committerWinnie Hellmann <winnie@gitlab.com>2019-05-08 00:32:53 +0300
commit4ce36f3443a3385468fd6fde0ae9f27d54ea1d37 (patch)
treed278526092c7c0ab1f68d9b3b088e17d945200c5 /spec/frontend/notes/stores
parentbc753559860935687f5eb285c8def2a178a673d7 (diff)
Add failing test for hasQuickActions
Diffstat (limited to 'spec/frontend/notes/stores')
-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'));
+ });
+});