diff options
Diffstat (limited to 'spec/frontend/vue_shared/components/todo_button_spec.js')
-rw-r--r-- | spec/frontend/vue_shared/components/todo_button_spec.js | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/spec/frontend/vue_shared/components/todo_button_spec.js b/spec/frontend/vue_shared/components/todo_button_spec.js deleted file mode 100644 index 8043bb7785b..00000000000 --- a/spec/frontend/vue_shared/components/todo_button_spec.js +++ /dev/null @@ -1,48 +0,0 @@ -import { GlButton } from '@gitlab/ui'; -import { shallowMount, mount } from '@vue/test-utils'; -import TodoButton from '~/vue_shared/components/todo_button.vue'; - -describe('Todo Button', () => { - let wrapper; - - const createComponent = (props = {}, mountFn = shallowMount) => { - wrapper = mountFn(TodoButton, { - propsData: { - ...props, - }, - }); - }; - - afterEach(() => { - wrapper.destroy(); - }); - - it('renders GlButton', () => { - createComponent(); - - expect(wrapper.find(GlButton).exists()).toBe(true); - }); - - it('emits click event when clicked', () => { - createComponent({}, mount); - wrapper.find(GlButton).trigger('click'); - - expect(wrapper.emitted().click).toBeTruthy(); - }); - - it.each` - label | isTodo - ${'Mark as done'} | ${true} - ${'Add a to do'} | ${false} - `('sets correct label when isTodo is $isTodo', ({ label, isTodo }) => { - createComponent({ isTodo }); - - expect(wrapper.find(GlButton).text()).toBe(label); - }); - - it('binds additional props to GlButton', () => { - createComponent({ loading: true }); - - expect(wrapper.find(GlButton).props('loading')).toBe(true); - }); -}); |