mirror of
https://github.com/sveltejs/svelte.git
synced 2024-11-29 16:36:44 +01:00
Failing test for #1743
global.getComputedStyle and global.navigator are needed for addResizeListener in shared/dom
This commit is contained in:
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…
Reference in New Issue
Block a user