mirror of https://github.com/sveltejs/svelte
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.
26 lines
450 B
26 lines
450 B
7 years ago
|
export default {
|
||
|
data: {
|
||
|
showModal: true
|
||
|
},
|
||
|
|
||
|
html: `
|
||
|
<div class='modal-background'></div>
|
||
|
|
||
|
<div class='modal'>
|
||
|
<h2>Hello!</h2>
|
||
|
<button>close modal</button>
|
||
|
</div>
|
||
|
`,
|
||
|
|
||
|
test ( assert, component, target, window ) {
|
||
|
const button = target.querySelector( 'button' );
|
||
|
const click = new window.MouseEvent( 'click' );
|
||
|
|
||
|
button.dispatchEvent( click );
|
||
|
|
||
|
assert.htmlEqual( target.innerHTML, `
|
||
|
<button>show modal</button>
|
||
|
`);
|
||
|
}
|
||
|
};
|