mirror of https://github.com/sveltejs/svelte
parent
d7c5dfbb06
commit
314a8b7622
@ -0,0 +1,29 @@
|
|||||||
|
export default {
|
||||||
|
html: `<div>1024x768</div>`,
|
||||||
|
|
||||||
|
skip: /^v4/.test( process.version ), // node 4 apparently does some dumb stuff
|
||||||
|
'skip-ssr': true, // there's some kind of weird bug with this test... it compiles with the wrong require.extensions hook for some bizarre reason
|
||||||
|
|
||||||
|
test ( assert, component, target, window ) {
|
||||||
|
const event = new window.Event( 'resize' );
|
||||||
|
|
||||||
|
// JSDOM executes window event listeners with `global` rather than
|
||||||
|
// `window` (bug?) so we need to do this
|
||||||
|
Object.defineProperties( global, {
|
||||||
|
innerWidth: {
|
||||||
|
value: 567,
|
||||||
|
configurable: true
|
||||||
|
},
|
||||||
|
innerHeight: {
|
||||||
|
value: 456,
|
||||||
|
configurable: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
window.dispatchEvent( event );
|
||||||
|
|
||||||
|
assert.htmlEqual( target.innerHTML, `
|
||||||
|
<div>567x456</div>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,3 @@
|
|||||||
|
<:Window bind:innerWidth='width' bind:innerHeight='height'/>
|
||||||
|
|
||||||
|
<div>{{width}}x{{height}}</div>
|
Loading…
Reference in new issue