Split off test

pull/7610/head
Nayan Gautam 4 years ago committed by gtmnayan
parent 3bec11a012
commit 92fa13c6d3

@ -0,0 +1,21 @@
export default {
html: `
<p style="font-size: 32px; color: red;"></p>
`,
solo: true,
test({ assert, target, window, component }) {
const p = target.querySelector("p");
const styles = window.getComputedStyle(p);
assert.equal(styles.color, "rgb(255, 0, 0)");
assert.equal(styles.fontSize, "32px");
component.foo = "font-size: 50px; color: green;"; // Update style attribute
{
const p = target.querySelector("p");
const styles = window.getComputedStyle(p);
assert.equal(styles.color, "rgb(255, 0, 0)");
assert.equal(styles.fontSize, "32px");
}
},
};

@ -0,0 +1,7 @@
<script>
export let foo = "font-size: 20px; color: blue;";
let bar = "32";
let baz = "red";
</script>
<p style:font-size="{bar}px" style:color={baz} style={foo} />

@ -9,12 +9,5 @@ export default {
const styles = window.getComputedStyle(p); const styles = window.getComputedStyle(p);
assert.equal(styles.color, "red"); assert.equal(styles.color, "red");
assert.equal(styles.height, "40px"); assert.equal(styles.height, "40px");
component.color2 = "yellow";
{
const p = target.querySelector("p");
const styles = window.getComputedStyle(p);
assert.equal(styles.color, "red");
}
}, },
}; };

@ -1,6 +1,5 @@
<script> <script>
export let color1 = 'red'; export let color = 'red';
export let color2 = 'blue';
</script> </script>
<p style="height: 40px; color: {color2};" style:color={color1} /> <p style="height: 40px; color: blue;" style:color={color} />

Loading…
Cancel
Save