Skip to content

Instantly share code, notes, and snippets.

@cezarpopa
Created April 29, 2022 20:05
Show Gist options
  • Save cezarpopa/43591e6f5758bbb3a9a4f9c58e8ee2e1 to your computer and use it in GitHub Desktop.
Save cezarpopa/43591e6f5758bbb3a9a4f9c58e8ee2e1 to your computer and use it in GitHub Desktop.
v.spec
import { mount } from '@vue/test-utils'
import MainHeader from '@/components/header/MainHeader.vue'
import router from "@/router"
const wrapper = mount(MainHeader, {
global: {
plugins: [router]
}
})
describe('MainHeader.vue', () => {
it('Home Active', () => {
expect(wrapper.find('.nav-link.active').text()).toMatch('Home');
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment