From 815d30fc9254ce6e1eaccb5dfc4edd3c1d6ff161 Mon Sep 17 00:00:00 2001 From: Cristian Necula Date: Fri, 3 Mar 2017 17:18:42 +0200 Subject: [PATCH] tests/render-in-iframe: added failing test for rendering in another document --- test/generator/render-in-iframe/_config.js | 21 +++++++++++++++++++++ test/generator/render-in-iframe/main.html | 6 ++++++ 2 files changed, 27 insertions(+) create mode 100644 test/generator/render-in-iframe/_config.js create mode 100644 test/generator/render-in-iframe/main.html diff --git a/test/generator/render-in-iframe/_config.js b/test/generator/render-in-iframe/_config.js new file mode 100644 index 0000000000..190a2b57de --- /dev/null +++ b/test/generator/render-in-iframe/_config.js @@ -0,0 +1,21 @@ +export default { + test ( assert, component, target, window ) { + const iframe = window.document.createElement('iframe'); + window.document.body.appendChild(iframe); + + const otherTarget = iframe.contentWindow.document.body; + + new component.constructor({ + target: otherTarget + }); + + assert.equal( + window.getComputedStyle(target.querySelector('h1')).color, + 'rgb(255, 0, 0)' + ); + assert.equal( + window.getComputedStyle(otherTarget.querySelector('h1')).color, + 'rgb(255, 0, 0)' + ); + } +}; diff --git a/test/generator/render-in-iframe/main.html b/test/generator/render-in-iframe/main.html new file mode 100644 index 0000000000..c67978fa51 --- /dev/null +++ b/test/generator/render-in-iframe/main.html @@ -0,0 +1,6 @@ +

Just some static HTML

+