Last active
May 17, 2021 16:41
-
-
Save aptiko/8d95b73e7c8481de40b5d410cc39d868 to your computer and use it in GitHub Desktop.
Nuxt test that involves the store and does not work
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 } from '@vue/test-utils' | |
import Navbar from '@/components/Navbar.vue' | |
describe('Navbar', () => { | |
test('gets loggedOnUser from store', () => { | |
const wrapper = mount(Navbar) | |
wrapper.vm.$store.commit('setLoggedOnUser', 'alice') | |
expect(wrapper.vm.loggedOnUser).toBe('alice') | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment