diff options
Diffstat (limited to 'spec/frontend/default/components/tabs_section_spec.js')
-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); + }); +}); |