diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 13:16:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 13:16:36 +0000 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/frontend/content_editor/extensions/emoji_spec.js | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) | |
download | gitlab-ce-311b0269b4eb9839fa63f80c8d7a58f32b8138a0.tar.gz |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/frontend/content_editor/extensions/emoji_spec.js')
-rw-r--r-- | spec/frontend/content_editor/extensions/emoji_spec.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/spec/frontend/content_editor/extensions/emoji_spec.js b/spec/frontend/content_editor/extensions/emoji_spec.js index c1b8dc9bdbb..939c46e991a 100644 --- a/spec/frontend/content_editor/extensions/emoji_spec.js +++ b/spec/frontend/content_editor/extensions/emoji_spec.js @@ -1,6 +1,6 @@ import { initEmojiMock } from 'helpers/emoji'; import Emoji from '~/content_editor/extensions/emoji'; -import { createTestEditor, createDocBuilder } from '../test_utils'; +import { createTestEditor, createDocBuilder, triggerNodeInputRule } from '../test_utils'; describe('content_editor/extensions/emoji', () => { let tiptapEditor; @@ -28,18 +28,16 @@ describe('content_editor/extensions/emoji', () => { describe('when typing a valid emoji input rule', () => { it('inserts an emoji node', () => { - const { view } = tiptapEditor; - const { selection } = view.state; const expectedDoc = doc( p( ' ', emoji({ moji: '❤', name: 'heart', title: 'heavy black heart', unicodeVersion: '1.1' }), ), ); - // Triggers the event handler that input rules listen to - view.someProp('handleTextInput', (f) => f(view, selection.from, selection.to, ':heart:')); - expect(eq(tiptapEditor.state.doc, expectedDoc)).toBe(true); + triggerNodeInputRule({ tiptapEditor, inputRuleText: ':heart:' }); + + expect(tiptapEditor.getJSON()).toEqual(expectedDoc.toJSON()); }); }); |