You’re browsing the documentation for Vue Test Utils for Vue v2.x and earlier.
To read docs for Vue Test Utils for Vue 3, click here.
classes()
Возвращает классы DOM-узла Wrapper.
Возвращает массив имён классов. Либо true/false если передано имя класса.
Аргументы:
{string} classNameопционально
Возвращает:
Array<{string}>Пример:
import { mount } from '@vue/test-utils'
import Foo from './Foo.vue'
const wrapper = mount(Foo)
expect(wrapper.classes()).toContain('bar')
expect(wrapper.classes('bar')).toBe(true)