Skip to content

Bug: DOM sometimes not being updated #1476

Closed
@SkippedTurn

Description

@SkippedTurn

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.)

To Reproduce
Here is a small repo in which the issue is reproduced: https://github.com/SkippedTurn/reproduction-recipe-test-utils. The line that seems to be causing the issue is ln7 in "TestComponent.vue".

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).

Related information:

  • @vue/test-utils version: 2.0.0-rc.21
  • Vue version: 3.2.33
  • node version: 18.1.0
  • npm version: 8.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions