[Bug Report] Unit Testing v-form causes "TypeError: Cannot read property 'componentInstance' of null"
See original GitHub issueVersions and Environment
Vuetify: 1.5.3 Vue: 2.6.7 Browsers: Chrome 72.0.3626.109 OS: Mac OS 10.14.2
Steps to reproduce
- Clone Repo
- Yarn install
- Run
yarn test:unit
Expected Behavior
- Tests pass when run individually
- Tests should pass when the entire suite is run
Actual Behavior
- Tests pass when run individually
- Tests break when the entire suite is run and v-form contains v-model=“valid”. If I remove the v-model then the entire test suite passes - of course, v-model is required for validation.
Reproduction Link
https://github.com/buys-fran/vue-form-test
Other comments
It could be a leaky test issue, but I am making use of vue-test-utils’ LocalVue to better isolate tests. I believe something in the internal workings of v-form causes this problem.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
Angular 5 / Jasmine Unit Test - Cannot read property ...
I found out the problem. The error message Cannot read property 'componentInstance' of undefined made me focus on the component = fixture.
Read more >cannot read property 'value' of undefined angular unit test ...
I'm new to Angular and Typescript and cannot get to the bottom of this console error: "ERROR TypeError: Cannot read property 'value' of...
Read more >Testing Components with children - Testing Angular
A unit test of HomeComponent does not render these children. The host elements are rendered, but they remain empty.
Read more >Angular unit testing 101 (with examples) - DEV Community
If for some reason you want to change it, you can do so in the test.ts file. Jasmine. Jasmine is a popular Javascript...
Read more >Angular Testing Cannot Read Property 'Name' Of Undefined
Empty jQuery objects are now properly shown in error messages in the Command Log. ... Jest and Enzyme unit test: TypeError: Cannot read...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I found a work around for our use case.
I will paste our setup here perhaps it will help someone.
@buys-fran this actually solves the problem stated above. cool