diff options
Diffstat (limited to 'spec/frontend/content_editor/services')
-rw-r--r-- | spec/frontend/content_editor/services/markdown_serializer_spec.js | 4 | ||||
-rw-r--r-- | spec/frontend/content_editor/services/track_input_rules_and_shortcuts_spec.js | 11 |
2 files changed, 2 insertions, 13 deletions
diff --git a/spec/frontend/content_editor/services/markdown_serializer_spec.js b/spec/frontend/content_editor/services/markdown_serializer_spec.js index 33056ab9e4a..cfd93c2df10 100644 --- a/spec/frontend/content_editor/services/markdown_serializer_spec.js +++ b/spec/frontend/content_editor/services/markdown_serializer_spec.js @@ -34,10 +34,6 @@ import { createTestEditor, createDocBuilder } from '../test_utils'; jest.mock('~/emoji'); -jest.mock('~/content_editor/services/feature_flags', () => ({ - isBlockTablesFeatureEnabled: jest.fn().mockReturnValue(true), -})); - const tiptapEditor = createTestEditor({ extensions: [ Blockquote, diff --git a/spec/frontend/content_editor/services/track_input_rules_and_shortcuts_spec.js b/spec/frontend/content_editor/services/track_input_rules_and_shortcuts_spec.js index afe09a75f16..459780cc7cf 100644 --- a/spec/frontend/content_editor/services/track_input_rules_and_shortcuts_spec.js +++ b/spec/frontend/content_editor/services/track_input_rules_and_shortcuts_spec.js @@ -10,7 +10,7 @@ import Heading from '~/content_editor/extensions/heading'; import ListItem from '~/content_editor/extensions/list_item'; import trackInputRulesAndShortcuts from '~/content_editor/services/track_input_rules_and_shortcuts'; import { ENTER_KEY, BACKSPACE_KEY } from '~/lib/utils/keys'; -import { createTestEditor } from '../test_utils'; +import { createTestEditor, triggerNodeInputRule } from '../test_utils'; describe('content_editor/services/track_input_rules_and_shortcuts', () => { let trackingSpy; @@ -70,14 +70,7 @@ describe('content_editor/services/track_input_rules_and_shortcuts', () => { describe('when creating a heading using an input rule', () => { it('sends a tracking event indicating that a heading was created using an input rule', async () => { const nodeName = Heading.name; - const { view } = editor; - const { selection } = view.state; - - // Triggers the event handler that input rules listen to - view.someProp('handleTextInput', (f) => f(view, selection.from, selection.to, '## ')); - - editor.chain().insertContent(HEADING_TEXT).run(); - + triggerNodeInputRule({ tiptapEditor: editor, inputRuleText: '## ' }); expect(trackingSpy).toHaveBeenCalledWith(undefined, INPUT_RULE_TRACKING_ACTION, { label: CONTENT_EDITOR_TRACKING_LABEL, property: `${nodeName}`, |