Creating some tests to check multi class feature

pull/3419/head
Marcelo Junior 6 years ago
parent 55593546c1
commit a065a23437

@ -0,0 +1,3 @@
export default {
html: `<div class="one two three four"></div>`
};

@ -0,0 +1 @@
<div class="one" class:two={true} class:three,four={true}></div>

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

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

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

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