mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Expose bug: Server-side render error
This commit is contained in:
parent
08c2e5d708
commit
8fb9ebd2b5
60
webapp/pages/settings/my-social-media.spec.js
Normal file
60
webapp/pages/settings/my-social-media.spec.js
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
import { shallowMount, mount, createLocalVue } from '@vue/test-utils'
|
||||||
|
import MySocialMedia from './my-social-media.vue'
|
||||||
|
import Vue from 'vue'
|
||||||
|
import Vuex from 'vuex'
|
||||||
|
import Styleguide from '@human-connection/styleguide'
|
||||||
|
|
||||||
|
const localVue = createLocalVue()
|
||||||
|
|
||||||
|
localVue.use(Vuex)
|
||||||
|
localVue.use(Styleguide)
|
||||||
|
|
||||||
|
describe('my-social-media.vue', () => {
|
||||||
|
let wrapper
|
||||||
|
let Wrapper
|
||||||
|
let store
|
||||||
|
let mocks
|
||||||
|
let getters
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
mocks = {
|
||||||
|
$t: jest.fn()
|
||||||
|
}
|
||||||
|
getters = {
|
||||||
|
'auth/user': () => {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('shallowMount', () => {
|
||||||
|
const Wrapper = () => {
|
||||||
|
store = new Vuex.Store({
|
||||||
|
getters
|
||||||
|
})
|
||||||
|
return shallowMount(MySocialMedia, { store, mocks, localVue })
|
||||||
|
}
|
||||||
|
|
||||||
|
it('renders', () => {
|
||||||
|
wrapper = Wrapper()
|
||||||
|
expect(wrapper.contains('div')).toBe(true)
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('given currentUser has social media accounts', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
getters = {
|
||||||
|
'auth/user': () => {
|
||||||
|
return {
|
||||||
|
socialMedia: ['']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
it('renders', () => {
|
||||||
|
wrapper = Wrapper()
|
||||||
|
expect(wrapper.contains('div')).toBe(true)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user