anchor.spec.js 382 B

12345678910111213
  1. import { haveAttribute, haveComputedStyle, html, notHaveAttribute, test } from '../../utils'
  2. test('can anchor an element',
  3. [html`
  4. <div x-data>
  5. <button x-ref="foo">toggle</button>
  6. <h1 x-anchor="$refs.foo">contents</h1>
  7. </div>
  8. `],
  9. ({ get }, reload) => {
  10. get('h1').should(haveComputedStyle('position', 'absolute'))
  11. },
  12. )