summaryrefslogtreecommitdiff
path: root/spec/frontend/vue_shared/components/markdown/field_spec.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 19:00:14 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 19:00:14 +0000
commit05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch)
tree11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /spec/frontend/vue_shared/components/markdown/field_spec.js
parentec73467c23693d0db63a797d10194da9e72a74af (diff)
downloadgitlab-ce-05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2.tar.gz
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'spec/frontend/vue_shared/components/markdown/field_spec.js')
-rw-r--r--spec/frontend/vue_shared/components/markdown/field_spec.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/frontend/vue_shared/components/markdown/field_spec.js b/spec/frontend/vue_shared/components/markdown/field_spec.js
index 285ea10c813..3b8e78bbadd 100644
--- a/spec/frontend/vue_shared/components/markdown/field_spec.js
+++ b/spec/frontend/vue_shared/components/markdown/field_spec.js
@@ -37,7 +37,7 @@ describe('Markdown field component', () => {
axiosMock.restore();
});
- function createSubject({ lines = [], enablePreview = true } = {}) {
+ function createSubject({ lines = [], enablePreview = true, showContentEditorSwitcher } = {}) {
// We actually mount a wrapper component so that we can force Vue to rerender classes in order to test a regression
// caused by mixing Vanilla JS and Vue.
subject = mountExtended(
@@ -68,6 +68,7 @@ describe('Markdown field component', () => {
lines,
enablePreview,
restrictedToolBarItems,
+ showContentEditorSwitcher,
},
},
);
@@ -191,6 +192,7 @@ describe('Markdown field component', () => {
markdownDocsPath,
quickActionsDocsPath: '',
showCommentToolBar: true,
+ showContentEditorSwitcher: false,
});
});
});
@@ -342,4 +344,18 @@ describe('Markdown field component', () => {
restrictedToolBarItems,
);
});
+
+ describe('showContentEditorSwitcher', () => {
+ it('defaults to false', () => {
+ createSubject();
+
+ expect(findMarkdownToolbar().props('showContentEditorSwitcher')).toBe(false);
+ });
+
+ it('passes showContentEditorSwitcher', () => {
+ createSubject({ showContentEditorSwitcher: true });
+
+ expect(findMarkdownToolbar().props('showContentEditorSwitcher')).toBe(true);
+ });
+ });
});