$el.spec.js 368 B

1234567891011121314
  1. import { haveText, html, test } from '../../utils'
  2. test('$el returns the current element',
  3. html`
  4. <div x-data>
  5. <button @click="$el.innerText = 'foo'">click me</button>
  6. </div>
  7. `,
  8. ({ get }) => {
  9. get('button').should(haveText('click me'))
  10. get('button').click()
  11. get('button').should(haveText('foo'))
  12. }
  13. )