mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Suggest a fix and some refinements
This commit is contained in:
parent
0ea3ea0481
commit
32856dd60f
@ -1,8 +1,6 @@
|
|||||||
import { config, mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import ComponentSlider from './ComponentSlider.vue'
|
import ComponentSlider from './ComponentSlider.vue'
|
||||||
|
|
||||||
config.stubs['nuxt-child'] = '<span><slot /></span>'
|
|
||||||
|
|
||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
|
|
||||||
describe('ComponentSlider.vue', () => {
|
describe('ComponentSlider.vue', () => {
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import Hashtag from './Hashtag'
|
|||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
|
|
||||||
config.stubs['nuxt-link'] = '<span><slot /></span>'
|
config.stubs['nuxt-link'] = '<span><slot /></span>'
|
||||||
config.stubs['nuxt-child'] = '<span><slot /></span>'
|
|
||||||
|
|
||||||
describe('Hashtag', () => {
|
describe('Hashtag', () => {
|
||||||
let id
|
let id
|
||||||
|
|||||||
@ -36,5 +36,9 @@ describe('PageFooter.vue', () => {
|
|||||||
it('renders four nuxt-links', () => {
|
it('renders four nuxt-links', () => {
|
||||||
expect(wrapper.findAll('.nuxt-link')).toHaveLength(4)
|
expect(wrapper.findAll('.nuxt-link')).toHaveLength(4)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('renders version', () => {
|
||||||
|
expect(wrapper.find('.ds-footer').text()).toContain('v1.0.0')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import { config, shallowMount } from '@vue/test-utils'
|
|||||||
import Default from './default.vue'
|
import Default from './default.vue'
|
||||||
|
|
||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
|
localVue.directive('scrollTo', jest.fn())
|
||||||
|
|
||||||
config.stubs.nuxt = '<span><slot /></span>'
|
config.stubs.nuxt = '<span><slot /></span>'
|
||||||
config.stubs['client-only'] = '<span><slot /></span>'
|
config.stubs['client-only'] = '<span><slot /></span>'
|
||||||
@ -15,13 +16,19 @@ describe('default.vue', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
mocks = {
|
mocks = {
|
||||||
|
$route: {
|
||||||
|
matched: [{ name: 'index' }],
|
||||||
|
},
|
||||||
|
$scrollTo: jest.fn(),
|
||||||
$t: jest.fn(),
|
$t: jest.fn(),
|
||||||
$env: {
|
$env: {
|
||||||
INVITE_REGISTRATION: true,
|
INVITE_REGISTRATION: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
store = new Vuex.Store({
|
store = new Vuex.Store({
|
||||||
getters: {},
|
getters: {
|
||||||
|
'auth/isLoggedIn': () => true,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,6 @@ config.stubs['client-only'] = '<span class="client-only"><slot /></span>'
|
|||||||
config.stubs['nuxt-link'] = '<span class="nuxt-link"><slot /></span>'
|
config.stubs['nuxt-link'] = '<span class="nuxt-link"><slot /></span>'
|
||||||
|
|
||||||
describe('Login.vue', () => {
|
describe('Login.vue', () => {
|
||||||
let mutations
|
|
||||||
let store
|
let store
|
||||||
let mocks
|
let mocks
|
||||||
let wrapper
|
let wrapper
|
||||||
@ -17,9 +16,6 @@ describe('Login.vue', () => {
|
|||||||
let redirect
|
let redirect
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
mutations = {
|
|
||||||
// 'posts/SELECT_ORDER': jest.fn(),
|
|
||||||
}
|
|
||||||
mocks = {
|
mocks = {
|
||||||
$t: jest.fn(),
|
$t: jest.fn(),
|
||||||
$i18n: {
|
$i18n: {
|
||||||
@ -39,7 +35,6 @@ describe('Login.vue', () => {
|
|||||||
return { termsAndConditionsAgreedVersion: tosVersion }
|
return { termsAndConditionsAgreedVersion: tosVersion }
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mutations,
|
|
||||||
})
|
})
|
||||||
if (asyncData) {
|
if (asyncData) {
|
||||||
const data = login.data ? login.data() : {}
|
const data = login.data ? login.data() : {}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { config, mount } from '@vue/test-utils'
|
|||||||
import enterNonce from './enter-nonce.vue'
|
import enterNonce from './enter-nonce.vue'
|
||||||
|
|
||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
|
|
||||||
config.stubs['nuxt-link'] = '<span class="nuxt-link"><slot /></span>'
|
config.stubs['nuxt-link'] = '<span class="nuxt-link"><slot /></span>'
|
||||||
|
|
||||||
describe('enter-nonce.vue', () => {
|
describe('enter-nonce.vue', () => {
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { config, mount } from '@vue/test-utils'
|
|||||||
import request from './request.vue'
|
import request from './request.vue'
|
||||||
|
|
||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
|
|
||||||
// config.stubs['sweetalert-icon'] = '<span><slot /></span>'
|
// config.stubs['sweetalert-icon'] = '<span><slot /></span>'
|
||||||
config.stubs['nuxt-link'] = '<span class="nuxt-link"><slot /></span>'
|
config.stubs['nuxt-link'] = '<span class="nuxt-link"><slot /></span>'
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { config, mount } from '@vue/test-utils'
|
|||||||
import _id from './_id.vue'
|
import _id from './_id.vue'
|
||||||
|
|
||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
|
|
||||||
config.stubs['nuxt-child'] = '<span class="nuxt-child"><slot /></span>'
|
config.stubs['nuxt-child'] = '<span class="nuxt-child"><slot /></span>'
|
||||||
|
|
||||||
describe('post/_id.vue', () => {
|
describe('post/_id.vue', () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user