diff options
Diffstat (limited to 'spec/frontend/integrations/edit/components/active_checkbox_spec.js')
-rw-r--r-- | spec/frontend/integrations/edit/components/active_checkbox_spec.js | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/spec/frontend/integrations/edit/components/active_checkbox_spec.js b/spec/frontend/integrations/edit/components/active_checkbox_spec.js index 76fd6dd3a48..0e56fb6454e 100644 --- a/spec/frontend/integrations/edit/components/active_checkbox_spec.js +++ b/spec/frontend/integrations/edit/components/active_checkbox_spec.js @@ -6,31 +6,27 @@ import { createStore } from '~/integrations/edit/store'; describe('ActiveCheckbox', () => { let wrapper; - const createComponent = (customStateProps = {}, isInheriting = false) => { + const createComponent = (customStateProps = {}, { isInheriting = false } = {}) => { wrapper = mount(ActiveCheckbox, { store: createStore({ customState: { ...customStateProps }, + override: !isInheriting, + defaultState: isInheriting ? {} : undefined, }), - computed: { - isInheriting: () => isInheriting, - }, }); }; afterEach(() => { - if (wrapper) { - wrapper.destroy(); - wrapper = null; - } + wrapper.destroy(); }); - const findGlFormCheckbox = () => wrapper.find(GlFormCheckbox); + const findGlFormCheckbox = () => wrapper.findComponent(GlFormCheckbox); const findInputInCheckbox = () => findGlFormCheckbox().find('input'); describe('template', () => { describe('is inheriting adminSettings', () => { it('renders GlFormCheckbox as disabled', () => { - createComponent({}, true); + createComponent({}, { isInheriting: true }); expect(findGlFormCheckbox().exists()).toBe(true); expect(findInputInCheckbox().attributes('disabled')).toBe('disabled'); |