You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/action/_config.js

23 lines
554 B

export default {
html: `
<button>action</button>
`,
test ( assert, component, target, window ) {
const button = target.querySelector( 'button' );
const eventEnter = new window.MouseEvent( 'mouseenter' );
const eventLeave = new window.MouseEvent( 'mouseleave' );
button.dispatchEvent( eventEnter );
assert.htmlEqual( target.innerHTML, `
<button>action</button>
<div class="tooltip">Perform an Action</div>
` );
button.dispatchEvent( eventLeave );
assert.htmlEqual( target.innerHTML, `
<button>action</button>
` );
}
};