Skip to content

Bug: isVisible() always returning true #1393

@rakibullahsazib

Description

@rakibullahsazib

Describe the bug

From the documentation, isVisible() should return false if v-show is false. But it is always returning true in the test. Although it is working perfectly in the browser.

To Reproduce

Here is the repo to reproduce the issue : https://github.com/rakibullahsazib/vitest-playground/tree/test-utils-visible-issue
Inside /src/components/visible folder is the Visible.vue component and the test file for it. Run yarn test to see test fail.

Expected behavior

isVisible() should return false when v-show is false.

Related information:

  • @vue/test-utils version: 2.0.0-rc.18
  • Vue version: 3.2.25
  • node version: 3.2.25
  • yarn version: 8.1.2
  • vitest version: 0.7.12

Additional context

I am not sure, but does it have anything to do with vitest. By the way, I have already checked the closed issue with similar problem. But you can see in the repo that the my code has no complex structure and yet it is causing the issue.

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