Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSarah German <sgerman@gitlab.com>2022-08-17 22:46:19 +0300
committerSuzanne Selhorn <sselhorn@gitlab.com>2022-08-17 22:46:19 +0300
commit00375ef7a3c7d0b5ff7381edd7eea0160312d539 (patch)
tree8083df6aea90397a015605f11e2835945c7c3a7f /spec
parent859ed69d6c7fe812f6d17a5bfdccaba4e3b4a11d (diff)
Support tabbed content on documentation pages
Diffstat (limited to 'spec')
-rw-r--r--spec/frontend/default/components/tabs_section_spec.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/frontend/default/components/tabs_section_spec.js b/spec/frontend/default/components/tabs_section_spec.js
new file mode 100644
index 00000000..ec5f5058
--- /dev/null
+++ b/spec/frontend/default/components/tabs_section_spec.js
@@ -0,0 +1,27 @@
+/**
+ * @jest-environment jsdom
+ */
+
+import { shallowMount } from '@vue/test-utils';
+import { GlTabs } from '@gitlab/ui';
+import TabsSection from '../../../../content/frontend/default/components/tabs_section.vue';
+
+describe('content/frontend/default/components/tabs_section.vue', () => {
+ it('Tabs are visible', () => {
+ const propsData = {
+ tabTitles: ['Tab one', 'Tab two'],
+ tabContents: ['Tab one content', 'Tab two content'],
+ };
+ const wrapper = shallowMount(TabsSection, { propsData });
+ expect(wrapper.findComponent(GlTabs).isVisible()).toBe(true);
+ });
+
+ it('validateTabContents', () => {
+ const propsData = {
+ tabTitles: ['Tab one', ''],
+ tabContents: ['Tab one content', 'Tab two content'],
+ };
+ const wrapper = shallowMount(TabsSection, { propsData });
+ expect(wrapper.findComponent(GlTabs).exists()).toBe(false);
+ });
+});