testing-library / vue-testing-library

🦎 Simple and complete Vue.js testing utilities that encourage good testing practices.
http://testing-library.com/vue
MIT License
1.06k stars 110 forks source link

updateProps dos not exist #280

Closed davidnixon closed 1 year ago

davidnixon commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

https://testing-library.com/docs/vue-testing-library/api#updatepropsprops Does not exist

To Reproduce Steps to reproduce the behavior:

   const result = render(MyComponent, { props });
   console.log(result.updateProps) // undefined

Expected behavior A clear and concise description of what you expected to happen.

updateProps is not defined but rerender is defined and works as expected according to the react docs https://testing-library.com/docs/react-testing-library/api/#rerender

I think updateProps should be removed from the vue section and replaced with something similar to the react doc.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here. package.json

    "@testing-library/dom": "^8.13.0",
    "@testing-library/user-event": "^14.2.0",
    "@testing-library/vue": "^6",
afontcu commented 1 year ago

Hi and thanks for reporting the issue!

As you mention, the actual method in v6 (for Vue 3) is rerender, aligned with other testing library methods (source).

I think updateProps should be removed from the vue section and replaced with something similar to the react doc.

Agree – docs are still talking about the v5 version of vue testing library, which works for Vue 2 (for instance they talk about the callback configuration function, which is no longer available). They need an update – fancy to work on it? It'd be greatly appreciated 😉

davidnixon commented 1 year ago

@afontcu https://github.com/testing-library/testing-library-docs/pull/1141