1
0

x-ignore.spec.js 634 B

1234567891011121314151617181920212223242526
  1. import { haveText, html, notHaveClasses, notHaveText, test } from '../../utils'
  2. test('x-ignore',
  3. html`
  4. <div x-data="{ foo: 'bar' }">
  5. <div x-ignore>
  6. <span x-text="foo"></span>
  7. </div>
  8. </div>
  9. `,
  10. ({ get }) => get('span').should(notHaveText('bar'))
  11. )
  12. test('x-ignore.self',
  13. html`
  14. <div x-data="{ foo: 'bar' }">
  15. <h1 x-ignore.self :class="foo">
  16. <span x-text="foo"></span>
  17. </h1>
  18. </div>
  19. `,
  20. ({ get }) => {
  21. get('span').should(haveText('bar'))
  22. get('h1').should(notHaveClasses(['bar']))
  23. }
  24. )