Skip to content
Advertisement

Tag: vue-test-utils

vue-test-utils returns null for document.querySelector

I am writing unit tests for a Vue.js component that displays some radiobuttons and emits an event with the radio button id whenever a button is checked: ApplicationElement.vue: I wrote the following test for said component: ApplicationElement.spec.js: The test fails with: “TypeError: Cannot read property ‘id’ of null” If I remove the document.querySelector line from the chooseElement method in the

Advertisement