blob: d5ecca4636cbd79ca091bcb632df6104ef3900c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
import { shallowMount } from '@vue/test-utils';
import ConfidentialityFilter from '~/search/sidebar/components/confidentiality_filter.vue';
import RadioFilter from '~/search/sidebar/components/radio_filter.vue';
describe('ConfidentialityFilter', () => {
let wrapper;
const createComponent = (initProps) => {
wrapper = shallowMount(ConfidentialityFilter, {
...initProps,
});
};
const findRadioFilter = () => wrapper.findComponent(RadioFilter);
describe('template', () => {
beforeEach(() => {
createComponent();
});
it('renders the component', () => {
expect(findRadioFilter().exists()).toBe(true);
});
});
describe.each`
hasFeatureFlagEnabled | paddingClass
${true} | ${'gl-px-5'}
${false} | ${'gl-px-0'}
`(`RadioFilter`, ({ hasFeatureFlagEnabled, paddingClass }) => {
beforeEach(() => {
createComponent({
provide: {
glFeatures: {
searchPageVerticalNav: hasFeatureFlagEnabled,
},
},
});
});
it(`has ${paddingClass} class`, () => {
expect(findRadioFilter().classes(paddingClass)).toBe(true);
});
});
});
|