summaryrefslogtreecommitdiff
path: root/spec/frontend/issuable_show/components/issuable_show_root_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/issuable_show/components/issuable_show_root_spec.js')
-rw-r--r--spec/frontend/issuable_show/components/issuable_show_root_spec.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/frontend/issuable_show/components/issuable_show_root_spec.js b/spec/frontend/issuable_show/components/issuable_show_root_spec.js
index 112e4ccd340..ca0aefc1083 100644
--- a/spec/frontend/issuable_show/components/issuable_show_root_spec.js
+++ b/spec/frontend/issuable_show/components/issuable_show_root_spec.js
@@ -118,6 +118,27 @@ describe('IssuableShowRoot', () => {
expect(wrapper.emitted('sidebar-toggle')).toBeTruthy();
});
+
+ it.each(['keydown-title', 'keydown-description'])(
+ 'component emits `%s` event with event object and issuableMeta params via issuable-body',
+ eventName => {
+ const eventObj = {
+ preventDefault: jest.fn(),
+ stopPropagation: jest.fn(),
+ };
+ const issuableMeta = {
+ issuableTitle: 'foo',
+ issuableDescription: 'foobar',
+ };
+
+ const issuableBody = wrapper.find(IssuableBody);
+
+ issuableBody.vm.$emit(eventName, eventObj, issuableMeta);
+
+ expect(wrapper.emitted(eventName)).toBeTruthy();
+ expect(wrapper.emitted(eventName)[0]).toMatchObject([eventObj, issuableMeta]);
+ },
+ );
});
});
});