import { beChecked, notBeChecked, haveAttribute, haveData, haveText, test, beVisible, notBeVisible, html } from '../../utils'
test('data modified in event listener updates affected attribute bindings',
html`
`,
({ get }) => {
get('span').should(haveAttribute('foo', 'bar'))
get('button').click()
get('span').should(haveAttribute('foo', 'baz'))
}
)
test('can call a method without parenthesis',
html`
`,
({ get }) => {
get('span').should(haveText('bar'))
get('button').click()
get('span').should(haveText('lob'))
}
)
test('event object is not passed if other params are present',
html`
`,
({ get }) => {
get('span').should(haveText('bar'))
get('button').click()
get('span').should(haveText('foo'))
}
)
test('nested data modified in event listener updates affected attribute bindings',
html`
`,
({ get }) => {
get('span').should(haveAttribute('foo', 'bar'))
get('button').click()
get('span').should(haveAttribute('foo', 'baz'))
}
)
test('.passive modifier should disable e.preventDefault()',
html`
`,
({ get }) => {
get('span').should(haveText('bar'))
get('span').click()
get('span').should(haveText('baz'))
}
)
test('expressions can start with if',
html`
`,
({ get }) => {
get('span').should(haveText('bar'))
get('button').click()
get('span').should(haveText('baz'))
}
)
test('unbind global event handler when element is removed',
html`
`,
({ get }) => {
get('span').should(haveText('bar'))
get('h1').click()
get('span').should(haveText('bar'))
get('h2').click()
get('span').should(haveText('baz'))
}
)
test('@click.away with x-show (prevent race condition)',
html`
h1
h2
`,
({ get }) => {
get('h1').should(notBeVisible())
get('button').click()
get('h1').should(beVisible())
}
)
test('event with colon',
html`
`,
({ get }) => {
get('span').should(haveText('bar'))
get('button').click()
get('span').should(haveText('baz'))
}
)
test('event instance can be passed to method reference',
html`