tests/render-in-iframe: added failing test for rendering in another document

pull/362/head
Cristian Necula 8 years ago
parent f799caedf1
commit 815d30fc92

@ -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)'
);
}
};

@ -0,0 +1,6 @@
<h1>Just some static HTML</h1>
<style>
h1 {
color: rgb(255, 0, 0);
}
</style>
Loading…
Cancel
Save