diff --git a/components/DisableModal.spec.js b/components/DisableModal.spec.js new file mode 100644 index 000000000..0ca8630f8 --- /dev/null +++ b/components/DisableModal.spec.js @@ -0,0 +1,51 @@ +import { shallowMount, mount, createLocalVue } from '@vue/test-utils' +import DisableModal from './DisableModal.vue' +import Vue from 'vue' +import Vuex from 'vuex' +import Styleguide from '@human-connection/styleguide' +import portal from 'portal-vue' + +const localVue = createLocalVue() + +localVue.use(Vuex) +localVue.use(Styleguide) +localVue.use(portal) + +describe('DisableModal.vue', () => { + let wrapper + let getters + let store + let mocks + + beforeEach(() => { + getters = { + 'modal/data': () => false + } + + store = new Vuex.Store({ + getters + }) + mocks = { $t: () => {} } + }) + + describe('mount', () => { + beforeEach(() => { + wrapper = mount(DisableModal, { store, mocks, localVue }) + }) + + it('renders', () => { + expect(wrapper.is('div')).toBe(true) + }) + }) + + describe('shallowMount', () => { + beforeEach(() => { + wrapper = shallowMount(DisableModal, { store, mocks, localVue }) + }) + describe('isOpen', () => { + it('defaults to false', () => { + expect(wrapper.vm.isOpen).toBe(false) + }) + }) + }) +}) diff --git a/components/DisableModal.vue b/components/DisableModal.vue new file mode 100644 index 000000000..5865d3e95 --- /dev/null +++ b/components/DisableModal.vue @@ -0,0 +1,144 @@ + + + + + diff --git a/components/ReportModal.vue b/components/ReportModal.vue index 1ae23fd94..f12072c0e 100644 --- a/components/ReportModal.vue +++ b/components/ReportModal.vue @@ -4,7 +4,7 @@ :is-open="isOpen" :confirm-label="$t('report.submit')" :cancel-label="$t('report.cancel')" - confrim-icon="warning" + confirm-icon="warning" @confirm="report" @cancel="close" >