$data.spec.js 381 B

1234567891011121314
  1. import { haveText, html, test } from '../../utils'
  2. test('$data returns the current scope (with cascading)',
  3. html`
  4. <div x-data="{ foo: 'bar'}">
  5. <div x-data="{ bob: 'lob' }">
  6. <span x-text="$data.foo + ' ' + $data.bob"></span>
  7. </div>
  8. </div>
  9. `,
  10. ({ get }) => {
  11. get('span').should(haveText('bar lob'))
  12. }
  13. )