[Test] Add test for class directive with spread attributes

pull/3242/head
Umang Galaiya 6 years ago
parent 70aa699496
commit 17247d8bb4

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

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