[Vuejs]-Vuetify v-data-table with vuex. Not rendering in unit test

0๐Ÿ‘

I tried changed my problem more simple.
Making store data before mounting, not rendering when pagination.sync exists.

import { mount } from 'avoriaz'
import Vue from 'vue'
import Vuetify from 'vuetify'
import DataTable from '@/components/DataTable'
import { store } from '../../../src/store/store.js'

Vue.use(Vuetify)

describe('Shop.vue', () => {
  it('uses store', () => {
    // build component
    store.state.items.push({name: 'AEON'})
    const wrapper2 = mount(DataTable, {store})
    expect(wrapper2.html()).toContain('AEON')
  })
})

Leave a comment