Parent.spec.js 693 B

12345678910111213141516171819202122232425
  1. import { mount, shallow } from '@vue/test-utils'
  2. import Parent from './components/Parent.vue'
  3. describe('Parent.vue', () => {
  4. it('mount snapshot', () => {
  5. const wrapper = mount(Parent)
  6. expect(wrapper.html()).toMatchSnapshot()
  7. expect(wrapper.element).toMatchSnapshot()
  8. })
  9. it('shallow snapshot', () => {
  10. const wrapper = shallow(Parent)
  11. expect(wrapper.html()).toMatchSnapshot()
  12. })
  13. it('properly serializes a shallowly-rendered wrapper', () => {
  14. const wrapper = shallow(Parent)
  15. expect(wrapper).toMatchSnapshot()
  16. })
  17. it('properly serializes a fully-mounted wrapper', () => {
  18. const wrapper = mount(Parent)
  19. expect(wrapper).toMatchSnapshot()
  20. })
  21. })