Last active
July 23, 2018 06:40
-
-
Save jamesoshea/4daf46f45ac91c0e6c3540d8fa25b755 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { mount, createLocalVue } from '@vue/test-utils'; | |
import Vuex from 'vuex'; | |
import CoolCard from '../components/CoolCard.vue'; | |
import StoreFactory from './utils/StoreFactory'; | |
const localVue = createLocalVue(); | |
localVue.use(Vuex); | |
const actions = { | |
incrementTotal: jest.fn() | |
}; | |
describe('CoolCard', () => { | |
let store; | |
beforeEach(() => { | |
store = StoreFactory( | |
{ | |
basket: { currentTotal: 567 } | |
}, | |
actions | |
); | |
}); | |
test('card should show correct total', () => { | |
const wrapper = mount(CoolCard, { store, localVue }); | |
expect(wrapper.vm.currentTotal).toEqual(567); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment