Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 456 Bytes

hasAttribute.md

File metadata and controls

21 lines (15 loc) · 456 Bytes

hasAttribute(attribute, value)

Assert every Wrapper in WrapperArray DOM node has attribute matching value.

  • Arguments:

    • {string} attribute
    • {string} value
  • Returns: {boolean}

  • Example:

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

const wrapper = mount(Foo)
const divArray = wrapper.findAll('div')
expect(divArray.hasAttribute('id', 'foo')).toBe(true)