From fd9dc300887ca9565d3b6dda5da73168f895e598 Mon Sep 17 00:00:00 2001 From: pk Date: Sun, 4 Nov 2018 20:25:57 +0100 Subject: [PATCH] Failing test for #1743 global.getComputedStyle and global.navigator are needed for addResizeListener in shared/dom --- test/helpers.js | 2 ++ .../_config.js | 8 ++++++++ .../main.html | 17 +++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/_config.js create mode 100644 test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/main.html diff --git a/test/helpers.js b/test/helpers.js index 7a04ff0262..7b1f08bb45 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -48,6 +48,8 @@ export function tryToReadFile(file) { export const virtualConsole = new jsdom.VirtualConsole(); const { window } = new jsdom.JSDOM('
', {virtualConsole}); global.document = window.document; +global.getComputedStyle = window.getComputedStyle; +global.navigator = {userAgent: 'fake'}; export function env() { window._svelteTransitionManager = null; diff --git a/test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/_config.js b/test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/_config.js new file mode 100644 index 0000000000..ff2b87b712 --- /dev/null +++ b/test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/_config.js @@ -0,0 +1,8 @@ +export default { + 'skip-ssr': true, + + test(assert, component, target) { + assert.ok(component.onstateRanBeforeOncreate); + assert.ok(!component.onupdateRanBeforeOncreate); + } +}; diff --git a/test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/main.html b/test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/main.html new file mode 100644 index 0000000000..d930bbcbbb --- /dev/null +++ b/test/runtime/samples/onupdate-after-concreate-using-bind-offsetWidth/main.html @@ -0,0 +1,17 @@ +
+