summaryrefslogtreecommitdiff
path: root/spec/frontend_integration
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend_integration')
-rw-r--r--spec/frontend_integration/content_editor/content_editor_integration_spec.js21
-rw-r--r--spec/frontend_integration/diffs/diffs_interopability_spec.js1
2 files changed, 21 insertions, 1 deletions
diff --git a/spec/frontend_integration/content_editor/content_editor_integration_spec.js b/spec/frontend_integration/content_editor/content_editor_integration_spec.js
index c0c6b5e5dc8..2fa491196ff 100644
--- a/spec/frontend_integration/content_editor/content_editor_integration_spec.js
+++ b/spec/frontend_integration/content_editor/content_editor_integration_spec.js
@@ -12,13 +12,16 @@ describe('content_editor', () => {
let wrapper;
let renderMarkdown;
- const buildWrapper = ({ markdown = '' } = {}) => {
+ const buildWrapper = ({ markdown = '', listeners = {} } = {}) => {
wrapper = mountExtended(ContentEditor, {
propsData: {
renderMarkdown,
uploadsPath: '/',
markdown,
},
+ listeners: {
+ ...listeners,
+ },
});
};
@@ -35,6 +38,10 @@ describe('content_editor', () => {
renderMarkdown = jest.fn();
});
+ afterEach(() => {
+ wrapper.destroy();
+ });
+
describe('when loading initial content', () => {
describe('when the initial content is empty', () => {
it('still hides the loading indicator', async () => {
@@ -169,4 +176,16 @@ This reference tag is a mix of letters and numbers [^footnote].
});
});
});
+
+ it('bubbles up the keydown event captured by ProseMirror', async () => {
+ const keydownHandler = jest.fn();
+
+ buildWrapper({ listeners: { keydown: keydownHandler } });
+
+ await waitUntilContentIsLoaded();
+
+ wrapper.find('[contenteditable]').trigger('keydown', {});
+
+ expect(wrapper.emitted('keydown')).toHaveLength(1);
+ });
});
diff --git a/spec/frontend_integration/diffs/diffs_interopability_spec.js b/spec/frontend_integration/diffs/diffs_interopability_spec.js
index 8e9bc4f0a5f..5017fb8c49d 100644
--- a/spec/frontend_integration/diffs/diffs_interopability_spec.js
+++ b/spec/frontend_integration/diffs/diffs_interopability_spec.js
@@ -121,6 +121,7 @@ describe('diffs third party interoperability', () => {
vm = startDiffsApp();
+ // eslint-disable-next-line jest/no-standalone-expect
await waitFor(() => expect(hasLines(rowSelector)).toBe(true));
});