summaryrefslogtreecommitdiff
path: root/spec/frontend/static_site_editor/components/publish_toolbar_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/static_site_editor/components/publish_toolbar_spec.js')
-rw-r--r--spec/frontend/static_site_editor/components/publish_toolbar_spec.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/spec/frontend/static_site_editor/components/publish_toolbar_spec.js b/spec/frontend/static_site_editor/components/publish_toolbar_spec.js
index 5428ed23266..9ba7e4a94d1 100644
--- a/spec/frontend/static_site_editor/components/publish_toolbar_spec.js
+++ b/spec/frontend/static_site_editor/components/publish_toolbar_spec.js
@@ -1,5 +1,4 @@
import { shallowMount } from '@vue/test-utils';
-import { GlButton } from '@gitlab/ui';
import PublishToolbar from '~/static_site_editor/components/publish_toolbar.vue';
@@ -11,6 +10,7 @@ describe('Static Site Editor Toolbar', () => {
const buildWrapper = (propsData = {}) => {
wrapper = shallowMount(PublishToolbar, {
propsData: {
+ hasSettings: false,
saveable: false,
...propsData,
},
@@ -18,7 +18,8 @@ describe('Static Site Editor Toolbar', () => {
};
const findReturnUrlLink = () => wrapper.find({ ref: 'returnUrlLink' });
- const findSaveChangesButton = () => wrapper.find(GlButton);
+ const findSaveChangesButton = () => wrapper.find({ ref: 'submit' });
+ const findEditSettingsButton = () => wrapper.find({ ref: 'settings' });
beforeEach(() => {
buildWrapper();
@@ -28,6 +29,10 @@ describe('Static Site Editor Toolbar', () => {
wrapper.destroy();
});
+ it('does not render Settings button', () => {
+ expect(findEditSettingsButton().exists()).toBe(false);
+ });
+
it('renders Submit Changes button', () => {
expect(findSaveChangesButton().exists()).toBe(true);
});
@@ -51,6 +56,14 @@ describe('Static Site Editor Toolbar', () => {
expect(findReturnUrlLink().attributes('href')).toBe(returnUrl);
});
+ describe('when providing settings CTA', () => {
+ it('enables Submit Changes button', () => {
+ buildWrapper({ hasSettings: true });
+
+ expect(findEditSettingsButton().exists()).toBe(true);
+ });
+ });
+
describe('when saveable', () => {
it('enables Submit Changes button', () => {
buildWrapper({ saveable: true });