diff options
author | Sarah German <sgerman@gitlab.com> | 2022-08-17 22:46:19 +0300 |
---|---|---|
committer | Suzanne Selhorn <sselhorn@gitlab.com> | 2022-08-17 22:46:19 +0300 |
commit | 00375ef7a3c7d0b5ff7381edd7eea0160312d539 (patch) | |
tree | 8083df6aea90397a015605f11e2835945c7c3a7f /spec | |
parent | 859ed69d6c7fe812f6d17a5bfdccaba4e3b4a11d (diff) |
Support tabbed content on documentation pages
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/default/components/tabs_section_spec.js | 27 |
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); + }); +}); |