Created
September 7, 2018 18:58
-
-
Save kuroski/91f45234eccdeab0a7c1614e7c9cdc20 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { shallowMount } from '@vue/test-utils' | |
import UserView from '@/views/UserView' | |
import VUserSearchForm from '@/components/VUserSearchForm' | |
import VUserProfile from '@/components/VUserProfile' | |
describe('UserView', () => { | |
it('renders the component', () => { | |
// arrange | |
const wrapper = shallowMount(UserView) | |
// assert | |
expect(wrapper.html()).toMatchSnapshot() | |
}) | |
it('renders main child components', () => { | |
// arrange | |
const wrapper = shallowMount(UserView) | |
const userSearchForm = wrapper.find(VUserSearchForm) | |
const userProfile = wrapper.find(VUserProfile) | |
// assert | |
expect(userSearchForm.exists()).toBe(true) | |
expect(userProfile.exists()).toBe(true) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment