Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 609 Bytes

hasStyle.md

File metadata and controls

24 lines (16 loc) · 609 Bytes

hasStyle(style, value)

Wrapper DOM ノードが値に一致するにスタイルを持つか検証します。

Wrapper DOM ノードが value に一致する style を持つ場合は、true を返します。

jsdom で実行しているときのみ、インラインスタイルを検出します。

  • 引数:

    • {string} style
    • {string} value
  • 戻り値: {boolean}

  • 例:

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

const wrapper = mount(Foo)
expect(wrapper.hasStyle('color', 'red')).toBe(true)