test: fix snapshots and sidebar test
This commit is contained in:
@@ -1,16 +1,25 @@
|
||||
import Vue from 'vue'
|
||||
import { shallowMount } from '@vue/test-utils';
|
||||
import { shallowMount, createLocalVue } from '@vue/test-utils';
|
||||
import CoreuiVue from '@coreui/vue'
|
||||
import Vuex from 'vuex'
|
||||
import TheSidebar from '@/containers/TheSidebar'
|
||||
|
||||
Vue.use(CoreuiVue)
|
||||
const localVue = createLocalVue()
|
||||
localVue.use(CoreuiVue)
|
||||
localVue.use(Vuex)
|
||||
|
||||
const store = new Vuex.Store({
|
||||
state: {
|
||||
sidebarShow: 'responsive',
|
||||
sidebarMinimize: false
|
||||
}
|
||||
})
|
||||
|
||||
describe('TheSidebar.vue', () => {
|
||||
it('has a name', () => {
|
||||
expect(TheSidebar.name).toBe('TheSidebar')
|
||||
})
|
||||
test('renders correctly', () => {
|
||||
const wrapper = shallowMount(TheSidebar)
|
||||
const wrapper = shallowMount(TheSidebar, { store, localVue })
|
||||
expect(wrapper.element).toMatchSnapshot()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user