From 19e5cd196dbdd02c9d9315e5037b7dae19034bae Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 11 Feb 2022 16:30:23 +0100 Subject: [PATCH] add Overlay.spec.js --- admin/src/components/Overlay.spec.js | 31 ++++++++++++++++++++++++++++ admin/src/components/Overlay.vue | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 admin/src/components/Overlay.spec.js diff --git a/admin/src/components/Overlay.spec.js b/admin/src/components/Overlay.spec.js new file mode 100644 index 000000000..9aa338bd9 --- /dev/null +++ b/admin/src/components/Overlay.spec.js @@ -0,0 +1,31 @@ +import { mount } from '@vue/test-utils' +import Overlay from './Overlay.vue' + +const localVue = global.localVue + +const propsData = { + items: {}, +} + +const mocks = { + $t: jest.fn((t) => t), + $d: jest.fn((d) => String(d)), +} + +describe('Overlay', () => { + let wrapper + + const Wrapper = () => { + return mount(Overlay, { localVue, mocks, propsData }) + } + + describe('mount', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('has a DIV element with the class.component-overlay', () => { + expect(wrapper.find('.component-overlay').exists()).toBeTruthy() + }) + }) +}) diff --git a/admin/src/components/Overlay.vue b/admin/src/components/Overlay.vue index 6f1d4ee0b..3f5106fcb 100644 --- a/admin/src/components/Overlay.vue +++ b/admin/src/components/Overlay.vue @@ -1,5 +1,5 @@