diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 18:25:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 18:25:58 +0000 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /spec/frontend/content_editor/components/top_toolbar_spec.js | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) | |
download | gitlab-ce-a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4.tar.gz |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/frontend/content_editor/components/top_toolbar_spec.js')
-rw-r--r-- | spec/frontend/content_editor/components/top_toolbar_spec.js | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/spec/frontend/content_editor/components/top_toolbar_spec.js b/spec/frontend/content_editor/components/top_toolbar_spec.js index 8f47be3f489..0a1405a1774 100644 --- a/spec/frontend/content_editor/components/top_toolbar_spec.js +++ b/spec/frontend/content_editor/components/top_toolbar_spec.js @@ -39,32 +39,35 @@ describe('content_editor/components/top_toolbar', () => { }); describe.each` - testId | buttonProps + testId | controlProps ${'bold'} | ${{ contentType: 'bold', iconName: 'bold', label: 'Bold text', editorCommand: 'toggleBold' }} ${'italic'} | ${{ contentType: 'italic', iconName: 'italic', label: 'Italic text', editorCommand: 'toggleItalic' }} ${'code'} | ${{ contentType: 'code', iconName: 'code', label: 'Code', editorCommand: 'toggleCode' }} ${'blockquote'} | ${{ contentType: 'blockquote', iconName: 'quote', label: 'Insert a quote', editorCommand: 'toggleBlockquote' }} ${'bullet-list'} | ${{ contentType: 'bulletList', iconName: 'list-bulleted', label: 'Add a bullet list', editorCommand: 'toggleBulletList' }} ${'ordered-list'} | ${{ contentType: 'orderedList', iconName: 'list-numbered', label: 'Add a numbered list', editorCommand: 'toggleOrderedList' }} - `('given a $testId toolbar control', ({ testId, buttonProps }) => { + ${'code-block'} | ${{ contentType: 'codeBlock', iconName: 'doc-code', label: 'Insert a code block', editorCommand: 'toggleCodeBlock' }} + ${'text-styles'} | ${{}} + ${'link'} | ${{}} + `('given a $testId toolbar control', ({ testId, controlProps }) => { beforeEach(() => { buildWrapper(); }); it('renders the toolbar control with the provided properties', () => { expect(wrapper.findByTestId(testId).props()).toEqual({ - ...buttonProps, + ...controlProps, tiptapEditor: contentEditor.tiptapEditor, }); }); it.each` - control | eventData - ${'bold'} | ${{ contentType: 'bold' }} - ${'blockquote'} | ${{ contentType: 'blockquote', value: 1 }} - `('tracks the execution of toolbar controls', ({ control, eventData }) => { + eventData + ${{ contentType: 'bold' }} + ${{ contentType: 'blockquote', value: 1 }} + `('tracks the execution of toolbar controls', ({ eventData }) => { const { contentType, value } = eventData; - wrapper.findByTestId(control).vm.$emit('execute', eventData); + wrapper.findByTestId(testId).vm.$emit('execute', eventData); expect(trackingSpy).toHaveBeenCalledWith(undefined, TOOLBAR_CONTROL_TRACKING_ACTION, { label: CONTENT_EDITOR_TRACKING_LABEL, |