mirror of https://github.com/sveltejs/svelte
parent
d603fe01eb
commit
46ded44077
@ -0,0 +1,17 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<div style="background-image: url(https://raw.githubusercontent.com/sveltejs/branding/master/svelte-vertical.png);"></div>
|
||||||
|
`,
|
||||||
|
|
||||||
|
test({ assert, target, window }) {
|
||||||
|
const div = target.querySelector('div');
|
||||||
|
const styles = window.getComputedStyle(div);
|
||||||
|
|
||||||
|
assert.equal(styles['background-image'], 'url(https://raw.githubusercontent.com/sveltejs/branding/master/svelte-vertical.png)');
|
||||||
|
|
||||||
|
assert.htmlEqual(
|
||||||
|
target.innerHTML,
|
||||||
|
'<div style="background-image: url(https://raw.githubusercontent.com/sveltejs/branding/master/svelte-vertical.png);"></div>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
<script>
|
||||||
|
let url =
|
||||||
|
"https://raw.githubusercontent.com/sveltejs/branding/master/svelte-vertical.png";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div style:background-image="url({url})" />
|
||||||
Loading…
Reference in new issue