mirror of https://github.com/sveltejs/svelte
parent
0d10d6cc2d
commit
51a3972ad5
@ -0,0 +1,16 @@
|
|||||||
|
export default {
|
||||||
|
data: {
|
||||||
|
"is-active": true,
|
||||||
|
isSelected: true,
|
||||||
|
myClass: 'one two'
|
||||||
|
},
|
||||||
|
html: `<div class="one two is-active isSelected"></div>`,
|
||||||
|
|
||||||
|
test ( assert, component, target, window ) {
|
||||||
|
component.set({ "is-active": false });
|
||||||
|
|
||||||
|
assert.htmlEqual( target.innerHTML, `
|
||||||
|
<div class="one two isSelected"></div>
|
||||||
|
` );
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1 @@
|
|||||||
|
<div class="{ myClass }" class:is-active class:isSelected class:not-used></div>
|
@ -1,16 +1,15 @@
|
|||||||
export default {
|
export default {
|
||||||
data: {
|
data: {
|
||||||
"is-active": true,
|
"is-active": true,
|
||||||
isSelected: true,
|
isSelected: true
|
||||||
myClass: 'one two'
|
|
||||||
},
|
},
|
||||||
html: `<div class="one two is-active isSelected"></div>`,
|
html: `<div class="is-active isSelected"></div>`,
|
||||||
|
|
||||||
test ( assert, component, target, window ) {
|
test ( assert, component, target, window ) {
|
||||||
component.set({ "is-active": false });
|
component.set({ "is-active": false });
|
||||||
|
|
||||||
assert.htmlEqual( target.innerHTML, `
|
assert.htmlEqual( target.innerHTML, `
|
||||||
<div class="one two isSelected"></div>
|
<div class="isSelected"></div>
|
||||||
` );
|
` );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1 +1 @@
|
|||||||
<div class="{ myClass }" class:is-active class:isSelected class:not-used></div>
|
<div class:is-active class:isSelected class:not-used></div>
|
||||||
|
Loading…
Reference in new issue