[Test] Add test for class with spread attributes

pull/3242/head
Umang Galaiya 6 years ago
parent 2b79a2269d
commit 70aa699496

@ -0,0 +1,21 @@
export default {
props: {
myClass: 'one two',
attributes: {
role: 'button'
}
},
html: `<div class="one two" role="button"></div>`,
test({ assert, component, target, window }) {
component.myClass = 'one';
component.attributes = {
'aria-label': 'Test'
};
assert.htmlEqual(target.innerHTML, `
<div class="one" aria-label="Test"></div>
`);
}
};

@ -0,0 +1,6 @@
<script>
export let myClass;
export let attributes = {};
</script>
<div class={myClass} {...attributes}></div>
Loading…
Cancel
Save