Skip to main content
Filter by
Sorted by
Tagged with
5 votes
1 answer
2k views

I have a nuxt page that redirects user if a condition fails in middleware, I'd like to test that a redirections occurs. middleware({ $featureFlag, store, route, redirect }) { if (!$featureFlag....
Seif's user avatar
  • 646
1 vote
1 answer
3k views

I'm new to testing and I'm trying to test a component with Vue test-utils, but I'm having trouble when I try to test a click on a imported component. This is my test file: import { Table, Input } ...
Gabriella Tavares's user avatar
1 vote
0 answers
719 views

Using the base project https://github.com/antfu/vitesse-webext I need to add the unit test capability, but getting error: SyntaxError: Cannot use import statement outside a module. I extended the ...
coure2011's user avatar
  • 42.8k
2 votes
2 answers
4k views

When testing a base button implementation using Jest and Vue-test-utils, the tests work but I am getting the following warning: [Vue warn]: Unknown custom element: b-button - did you register the ...
Spike's user avatar
  • 151
0 votes
1 answer
169 views

I have following method in vue file in which api call is there as below getZipcode(city){ ajax.get(`${CONSTANTS.STANDARDAPIURL}Geographic/ZipCode?cityName=${city}`, {}, (res) => { ...
vish_nue's user avatar
1 vote
1 answer
1k views

I have following beforeDestroy hook in Employee.vue file beforeDestroy() { this.checkIncompleteValues() } and in test file unit test written as test('beforeDestroy method', () => { const ...
vish_nue's user avatar
0 votes
0 answers
618 views

I have a vue component that fetches data from an api in the "created" function. I'm just getting up and running using the following testing stack: "devDependencies": { "@...
karns's user avatar
  • 5,937
1 vote
1 answer
1k views

I'm using jest / vue-test-utils to test a component, and I can't find a way to set props if they are used in mounted(). The component has one prop queryFilter: { type: Object } which is used within ...
daniel p's user avatar
  • 989
2 votes
1 answer
2k views

I'm use jest with vue-test-utils and I want test method for upload files. This method in vue file component. async uploadFiles(file){ this.$refs.iconUpload.setAttribute('data-load', 'loading') let ...
Dpace Space's user avatar
0 votes
1 answer
1k views

I have a strange problem with testing the frontend part of my project. I use Vue components for the frontend. The project is website for teachers to set appointments for the assistent(s) so the ...
KvdLingen's user avatar
  • 1,341
1 vote
1 answer
4k views

When I try using wrapper.findComponent, I get the following error: ErrorWrapper { selector: { ref: 'loginTab' } } I have searched online but to no avail. Here is my test code: describe('Sign-Up Test ...
Cacious's user avatar
  • 175
3 votes
1 answer
909 views

I am testing a VueJS 2 application using vue-test-utils library and I want to check if the mixin was passed to specific component, something like mounting the component using mount and accessing the ...
William's user avatar
  • 502
-1 votes
1 answer
580 views

I have code inside validate method if condition true it returns true else false. I want to test that code. Is there any way to do it.
Vishal Sagar's user avatar
1 vote
1 answer
1k views

I have some img tag which I fill it with dynamic address with require, it works as expected in the component but when I write a test for it throws this error console.error Error: Configuration ...
Mohammad's user avatar
  • 681
1 vote
1 answer
318 views

Here is my code. I want to DRY up this case. describe("Stored id", () => { it("ID empty", () => { // when const wrapper = mount(SigninPage, options); const vm ...
Jihogrammer's user avatar
1 vote
1 answer
4k views

I'm trying to mock an axios put request in nuxt.js like this: The component method(Composition API approach): const doSomething = async (): Promise<void> => { const token = $cookies.get(&...
Mohammad's user avatar
  • 681
1 vote
1 answer
1k views

I have trouble with finding a good resource for writing tests for my component which is using Vuex with Typescript and Composition Api in Nuxt2, and how can I do this? Here is my component codes: <...
Mohammad's user avatar
  • 681
1 vote
1 answer
501 views

I'm trying to write a unit test for a VueJS 2 component that has a dynamic component that changes as the state changes. <template> <div> <component ref="dynamicComponent" ...
sparky's user avatar
  • 112
1 vote
0 answers
247 views

I'm trying to develop a VueJs 3 component (and composition API) with TDD approach. The UI : It's a Pop Up that contain a file uploader. The user have to select a file, then a validation button should ...
CyrilHskt's user avatar
  • 151
0 votes
1 answer
452 views

I created a global guard that uses getters from store. I am trying to mock some getters from store for testing purpose. The problem is that mocking does not work. // router/index.ts export function ...
Amir Choubani's user avatar
0 votes
1 answer
760 views

When i am learning the vue-test-utils from the offical site conditional-rendering. I tried to change the option api to composition api. It seems like the mount option data not working with the ...
Li Kui's user avatar
  • 670
1 vote
1 answer
1k views

I'm having an issue trying to test what the contents of a v-text-field object is and it's driving me crazy. I'm having a bit of trouble following the documentation, so any help is appreciated. I have ...
JasonWilczak's user avatar
  • 2,413
0 votes
1 answer
813 views

I have created a local Vue app and I need to mix a method into all components. The problem is whenever I mount the app the method does not appear to be mixed for child components. Here is my code: ...
user8555937's user avatar
  • 2,425
2 votes
0 answers
1k views

I have a Vuejs project with Jest and Vue test utils. Currently I'm running my unit tests in JsDom test environment. I want to change my test environment to "node", because it's a lot faster ...
eXception's user avatar
  • 2,419
0 votes
0 answers
579 views

i try to create a simple test who : click on button show if dropdown is open i try to simulate a click with trigger but it is not working, do you have any idea what i am doing wrong? describe('...
Lanfeust2000's user avatar

1
3 4
5
6 7
17