From 37c04849dd8a981c230bda268dafa4f448d595f0 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 26 Apr 2021 00:35:09 +0200 Subject: [PATCH] coverage default.spec.js --- webapp/layouts/default.spec.js | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 webapp/layouts/default.spec.js diff --git a/webapp/layouts/default.spec.js b/webapp/layouts/default.spec.js new file mode 100644 index 000000000..13933d821 --- /dev/null +++ b/webapp/layouts/default.spec.js @@ -0,0 +1,45 @@ +import Vuex from 'vuex' +import { config, shallowMount } from '@vue/test-utils' +import Default from './default.vue' + +const localVue = global.localVue + +config.stubs['nuxt'] = '' +config.stubs['client-only'] = '' +config.stubs['nuxt-link'] = '' + +describe('default.vue', () => { + let wrapper + let mocks + let store + + beforeEach(() => { + mocks = { + $t: jest.fn(), + $env: { + INVITE_REGISTRATION: true + }, + } + store = new Vuex.Store({ + getters: {}, + }) + }) + + describe('shallow mount', () => { + const Wrapper = () => { + return shallowMount(Default, { + store, + mocks, + localVue, + }) + } + + beforeEach(() => { + wrapper = Wrapper() + }) + + it('renders', () => { + expect(wrapper.is('.layout-default')).toBe(true) + }) + }) +})