Failing test for #1743

global.getComputedStyle and global.navigator are needed for
addResizeListener in shared/dom
pull/1836/head
pk 6 years ago
parent 1f79099d2f
commit fd9dc30088

@ -48,6 +48,8 @@ export function tryToReadFile(file) {
export const virtualConsole = new jsdom.VirtualConsole();
const { window } = new jsdom.JSDOM('<main></main>', {virtualConsole});
global.document = window.document;
global.getComputedStyle = window.getComputedStyle;
global.navigator = {userAgent: 'fake'};
export function env() {
window._svelteTransitionManager = null;

@ -0,0 +1,8 @@
export default {
'skip-ssr': true,
test(assert, component, target) {
assert.ok(component.onstateRanBeforeOncreate);
assert.ok(!component.onupdateRanBeforeOncreate);
}
};

@ -0,0 +1,17 @@
<div bind:offsetWidth=width></div>
<script>
export default {
onstate() {
this.onstateRan = true;
},
onupdate() {
this.onupdateRan = true;
},
oncreate() {
this.onstateRanBeforeOncreate = this.onstateRan;
this.onupdateRanBeforeOncreate = this.onupdateRan;
}
};
</script>
Loading…
Cancel
Save