-
Notifications
You must be signed in to change notification settings - Fork 110
Closed
Labels
Description
Environment
- Operating System: Linux
- Node Version: v18.20.3
- Nuxt Version: 3.12.2
- CLI Version: 3.12.0
- Nitro Version: 2.9.6
- Package Manager: npm@10.2.3
- Builder: -
- User Config: devtools, modules
- Runtime Modules: @nuxt/test-utils/module@3.13.1
- Build Modules: -
Reproduction
https://stackblitz.com/edit/nuxt-starter-ncxs25?file=components%2FTest.spec.ts
Describe the bug
I called setProps on Component has an Array type prop. However, the resulting prop value is a concatenation of the new array value and the old array value.
const wrapper = await mountSuspended(Test, {
props: {
users: [
{ id: 0, name: 'John' },
{ id: 1, name: 'Kate' },
],
},
});
expect(wrapper.html()).toContain('John'); // props contain John and Kate
await wrapper.setProps({ users: [{ id: 2, name: 'Bob' }] });
expect(wrapper.html()).not.toContain('John'); // !! props contain Bob, John and KateThis issue occurs when using Wrapper from mountSuspended, but it does not occur when using @vue/test-utils's mount.
What could be the cause of this behavior?
Additional context
No response
Logs
No response
Reactions are currently unavailable