You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
As of the test-utils version 2.0.0-rc.21, some of our tests started failing seemingly because the DOM was not being updated. For one component I managed to narrow the cause of this down to an equality check between two objects somehow no longer resolving to true, even when they both refer to the same object.
(Unfortunately the other components for which tests were broken are relatively old code, so I couldn't immediately verify whether those failures share a similar cause.)
In the above project, if the v-if is replaced with v-if="selectedField?.name === field.name" so that the check is done on strings instead of Objects, everything does work again.
Expected behavior
The equality check resolves to true, and the associated tests succeed.
Note that, outside of the tests, the component works as intended with the latest version of Vue (3.2.33).
Looks like we have a fix. That said, relying on object equality seems unideal in general - comparing primitives seems far superior, with no real downside.
@lmiller1990 I agree with that, and this bit of code will probably be refactored to just that at some point to make it a bit more robust. But in the meantime: thank you for the fix!
Activity
freakzlike commentedon May 4, 2022
This is caused by #1434. We might need to revert this changes and find another way to get props with Ref working.
chore: Add regression tests for vuejs#1476
freakzlike commentedon May 6, 2022
Just as hint: I was able to run your reproduction successfully with:
or
Maybe this workaround is easier for you instead of changing the
v-iflmiller1990 commentedon May 20, 2022
Looks like we have a fix. That said, relying on object equality seems unideal in general - comparing primitives seems far superior, with no real downside.
regression: #1476 reactive prop object compare (#1479)
SkippedTurn commentedon May 24, 2022
@lmiller1990 I agree with that, and this bit of code will probably be refactored to just that at some point to make it a bit more robust. But in the meantime: thank you for the fix!