Skip to content

Bug: isVisible weird behavior for 2.3.2 version #2016

@andinh-minacolor

Description

@andinh-minacolor

Describe the bug
I have been using version 2.2.6 for a while and it works great then I tried to update this module to 2.3.2 and got the issue with isVisible function behavior. As provided below, after accessing isVisible for first time it's value will not be changed later even the virtual DOM has been updated correctly.

To Reproduce
This is the component

<template>
  <div v-show="show">
    <span />
    <button @click="onClick"></button>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";

const show = ref(true)

const onClick = () => {
  show.value = !show.value
}

</script>

This is the test

import { mount } from '@vue/test-utils';
import check from './check.vue'

test('isVisible', async () => {
  const wrapper = mount(check)
  expect(wrapper.find('span').isVisible()).toBe(true)
  await wrapper.find('button').trigger('click')
  console.log("***> wrapper", wrapper.html())
  // this value will always be true, but if I remove the isVisible code above it will be false.
  expect(wrapper.find('span').isVisible()).toBe(false)
})

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