wrapper.findComponent not working for @vue/test-utils

URGENT: When I try using wrapper.findComponents, I get the following error: ErrorWrapper { selector: { ref: 'loginTab' } }
Here is my code:

import {mount, createLocalVue} from '@vue/test-utils'
import Vuex from 'vuex'
import Vuetify from 'vuetify'
import SignUp from '../../src/components/Provision-Setup-Dialog-(Signup).vue'

const localVue = createLocalVue()
localVue.use(Vuex)
localVue.use(Vuetify)

describe('Sign-Up Test Cases', () => {
	let actions
	let mutations

	const wrapper = mount(SignUp, {
		mocks: {
			$route: {
				query: {
					'email-verify': true
				}
			}
		},
		computed: {
			prov () {
				return {
					setup: true,
					flags: ['STANDALONE']
				}
					
			}
		},
		methods: {
			getProv: jest.fn()
		},
		localVue
	})
	
	it('Is a Vue Component', () => {
		expect(wrapper.vm).toBeTruthy()
	})
	it('Is a Dialog', () => {
		expect(wrapper.vm._data.dialog).toBe(true)
	})
	it('Dialog contains a Login Input Field', () => {
		console.log(wrapper.findComponent({ ref: 'loginTab' }))
		expect(wrapper.findComponent({ ref: 'loginTab' }))
	})
})

Check the last it statement where I am using the findComponent function. Please help.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.