chore: write a unit test for offsetWidth/offsetHeight (WIP)

pull/8096/head
Jos de Jong 4 years ago
parent 9a9db1c70f
commit 2a5a4aadfa

@ -0,0 +1,5 @@
export default {
async test({ assert, target }) {
assert.htmlEqual(target.querySelector('.description').innerHTML, 'width:200, height:100');
}
};

@ -0,0 +1,22 @@
<script>
let offsetWidth = 0;
let offsetHeight = 0;
</script>
<div class="wrapper">
<div class="inner" bind:offsetHeight bind:offsetWidth>
<div class="description">width:{offsetWidth}, height:{offsetHeight}</div>
</div>
</div>
<style>
.wrapper {
width: 200px;
height: 100px;
}
.inner {
width: 100%;
height: 100%
}
</style>
Loading…
Cancel
Save