Suggest a fix and some refinements

This commit is contained in:
Wolfgang Huß 2021-05-06 09:58:37 +02:00
parent 0ea3ea0481
commit 32856dd60f
8 changed files with 16 additions and 10 deletions

View File

@ -1,8 +1,6 @@
import { config, mount } from '@vue/test-utils'
import { mount } from '@vue/test-utils'
import ComponentSlider from './ComponentSlider.vue'
config.stubs['nuxt-child'] = '<span><slot /></span>'
const localVue = global.localVue
describe('ComponentSlider.vue', () => {

View File

@ -5,7 +5,6 @@ import Hashtag from './Hashtag'
const localVue = global.localVue
config.stubs['nuxt-link'] = '<span><slot /></span>'
config.stubs['nuxt-child'] = '<span><slot /></span>'
describe('Hashtag', () => {
let id

View File

@ -36,5 +36,9 @@ describe('PageFooter.vue', () => {
it('renders four nuxt-links', () => {
expect(wrapper.findAll('.nuxt-link')).toHaveLength(4)
})
it('renders version', () => {
expect(wrapper.find('.ds-footer').text()).toContain('v1.0.0')
})
})
})

View File

@ -3,6 +3,7 @@ import { config, shallowMount } from '@vue/test-utils'
import Default from './default.vue'
const localVue = global.localVue
localVue.directive('scrollTo', jest.fn())
config.stubs.nuxt = '<span><slot /></span>'
config.stubs['client-only'] = '<span><slot /></span>'
@ -15,13 +16,19 @@ describe('default.vue', () => {
beforeEach(() => {
mocks = {
$route: {
matched: [{ name: 'index' }],
},
$scrollTo: jest.fn(),
$t: jest.fn(),
$env: {
INVITE_REGISTRATION: true,
},
}
store = new Vuex.Store({
getters: {},
getters: {
'auth/isLoggedIn': () => true,
},
})
})

View File

@ -8,7 +8,6 @@ config.stubs['client-only'] = '<span class="client-only"><slot /></span>'
config.stubs['nuxt-link'] = '<span class="nuxt-link"><slot /></span>'
describe('Login.vue', () => {
let mutations
let store
let mocks
let wrapper
@ -17,9 +16,6 @@ describe('Login.vue', () => {
let redirect
beforeEach(() => {
mutations = {
// 'posts/SELECT_ORDER': jest.fn(),
}
mocks = {
$t: jest.fn(),
$i18n: {
@ -39,7 +35,6 @@ describe('Login.vue', () => {
return { termsAndConditionsAgreedVersion: tosVersion }
},
},
mutations,
})
if (asyncData) {
const data = login.data ? login.data() : {}

View File

@ -2,6 +2,7 @@ import { config, mount } from '@vue/test-utils'
import enterNonce from './enter-nonce.vue'
const localVue = global.localVue
config.stubs['nuxt-link'] = '<span class="nuxt-link"><slot /></span>'
describe('enter-nonce.vue', () => {

View File

@ -2,6 +2,7 @@ import { config, mount } from '@vue/test-utils'
import request from './request.vue'
const localVue = global.localVue
// config.stubs['sweetalert-icon'] = '<span><slot /></span>'
config.stubs['nuxt-link'] = '<span class="nuxt-link"><slot /></span>'

View File

@ -2,6 +2,7 @@ import { config, mount } from '@vue/test-utils'
import _id from './_id.vue'
const localVue = global.localVue
config.stubs['nuxt-child'] = '<span class="nuxt-child"><slot /></span>'
describe('post/_id.vue', () => {