Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 486 Bytes

isVisible.md

File metadata and controls

21 lines (14 loc) · 486 Bytes

isVisible()

Assert Wrapper is visible.

Returns false if an ancestor element has display: none or visibility: hidden style.

This can be used to assert that a component is hidden by v-show.

  • Returns: {boolean}

  • Example:

import { mount } from 'vue-test-utils'
import { expect } from 'chai'
import Foo from './Foo.vue'

const wrapper = mount(Foo)
expect(wrapper.isVisible()).toBe(true)
expect(wrapper.find('.is-not-visible').isVisible()).toBe(false)