diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-23 18:12:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-23 18:12:28 +0300 |
commit | 98014c0c43c1b1114d17c5851cd6313a9011d3ab (patch) | |
tree | 405bb6fb3e3e1bbdad0be2e4de43e353db8aeebd /spec/frontend/vue_shared | |
parent | 3f274363e9dc9a1be75edfcd3dd5adb64b1e8c29 (diff) |
Add latest changes from gitlab-org/gitlab@14-8-stable-ee
Diffstat (limited to 'spec/frontend/vue_shared')
-rw-r--r-- | spec/frontend/vue_shared/components/markdown/header_spec.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/frontend/vue_shared/components/markdown/header_spec.js b/spec/frontend/vue_shared/components/markdown/header_spec.js index 93ce3935fab..700ec75fcee 100644 --- a/spec/frontend/vue_shared/components/markdown/header_spec.js +++ b/spec/frontend/vue_shared/components/markdown/header_spec.js @@ -20,6 +20,7 @@ describe('Markdown field header component', () => { const findWriteTab = () => wrapper.findByTestId('write-tab'); const findPreviewTab = () => wrapper.findByTestId('preview-tab'); + const findToolbar = () => wrapper.findByTestId('md-header-toolbar'); const findToolbarButtons = () => wrapper.findAll(ToolbarButton); const findToolbarButtonByProp = (prop, value) => findToolbarButtons() @@ -90,6 +91,12 @@ describe('Markdown field header component', () => { expect(findPreviewTab().attributes('active')).toBe('true'); }); + it('hides toolbar in preview mode', () => { + createWrapper({ previewMarkdown: true }); + + expect(findToolbar().classes().includes('gl-display-none')).toBe(true); + }); + it('emits toggle markdown event when clicking preview tab', async () => { const eventData = { target: {} }; findPreviewTab().vm.$emit('click', eventData); |