Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 513 Bytes

hasAttribute.md

File metadata and controls

21 lines (15 loc) · 513 Bytes

hasAttribute(attribute, value)

Asserte que chaque Wrapper de WrapperArray a un nœud du DOM qui a un attribut ayant une certaine valeur.

  • Paramètres :

    • {string} attribute : l'attribut
    • {string} value : la valeur
  • Retourne : {boolean}

  • Exemple :

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)