Skip to content

FireEvent not getting resolved #44

Closed
@OgaBoss

Description

@OgaBoss

I just installed the library

devDependencies": {
    "@testing-library/vue": "^1.0.3",
    "@vue/cli-plugin-babel": "^3.0.3",
    "@vue/cli-plugin-e2e-cypress": "^3.0.3",
    "@vue/cli-plugin-eslint": "^3.0.3",
    "@vue/cli-plugin-pwa": "^3.8.0",
    "@vue/cli-plugin-unit-jest": "^3.0.3",
    "@vue/cli-service": "^3.0.3",
    "@vue/test-utils": "1.0.0-beta.29",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "^10.0.1",
    "babel-jest": "^23.6.0",
    "eslint": "^5.16.0",
    "eslint-plugin-vue": "^5.0.0",
    "node-sass": "^4.9.0",
    "sass-loader": "^7.1.0",
    "tailwindcss": "^1.0.4",
    "vue-template-compiler": "^2.6.10"
  }

But when i do import { render, fireEvent, cleanup } from '@testing-library/vue' and use it my test

import { render, fireEvent, cleanup } from '@testing-library/vue'
import Input from '../input.vue';
import VTooltip from 'v-tooltip'

describe('Test the Input component function', () => {
	afterEach(cleanup)
	const props = {
		loginMethod: 'phone'
	}
	test('input toggle when icon is clicked', () => {
		const {getByPlaceholderText, getByTestId} = render(Input, {props}, vue => {
			vue.use(VTooltip)
		})

		getByPlaceholderText('Enter a phone number')
		fireEvent.click(getByTestId('toggle-icon'))
		getByPlaceholderText('Email')

	})
})

I get this
Screen Shot 2019-06-21 at 11 27 13 AM

And even my IDE (webstorm) cannot resolve fireEvent

Please what am i doing wrong ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions