Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 441 Bytes

attributes.md

File metadata and controls

20 lines (13 loc) · 441 Bytes

attributes

Returns Wrapper DOM node attribute object. If key is provided, the value for the key will be returned.

  • Arguments:

    • {string} key optional
  • Returns: {[attribute: string]: any} | string

  • Example:

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

const wrapper = mount(Foo)
expect(wrapper.attributes().id).toBe('foo')
expect(wrapper.attributes('id')).toBe('foo')