mirror of https://github.com/sveltejs/svelte
parent
65680bf445
commit
b58dad00f3
@ -1,24 +1,24 @@
|
|||||||
export default {
|
export default {
|
||||||
html: '<div><p></p></div>',
|
html: '<div><p></p></div>',
|
||||||
|
|
||||||
test ( assert, component, target ) {
|
test(assert, component, target) {
|
||||||
const widget = component.widget;
|
const { widget } = component;
|
||||||
|
|
||||||
assert.equal( widget.get().show, false );
|
assert.equal(widget.show, false);
|
||||||
|
|
||||||
widget.set({show: true});
|
widget.show = true;
|
||||||
assert.htmlEqual( target.innerHTML, '<div><p>Hello</p></div>' );
|
assert.htmlEqual(target.innerHTML, '<div><p>Hello</p></div>');
|
||||||
|
|
||||||
component.data = 'World';
|
component.data = 'World';
|
||||||
assert.htmlEqual( target.innerHTML, '<div><p>World</p></div>' );
|
assert.htmlEqual(target.innerHTML, '<div><p>World</p></div>');
|
||||||
|
|
||||||
widget.set({show: false});
|
widget.show = false;
|
||||||
assert.htmlEqual( target.innerHTML, '<div><p></p></div>' );
|
assert.htmlEqual(target.innerHTML, '<div><p></p></div>');
|
||||||
|
|
||||||
component.data = 'Goodbye';
|
component.data = 'Goodbye';
|
||||||
assert.htmlEqual( target.innerHTML, '<div><p></p></div>' );
|
assert.htmlEqual(target.innerHTML, '<div><p></p></div>');
|
||||||
|
|
||||||
widget.set({show: true});
|
widget.show = true;
|
||||||
assert.htmlEqual( target.innerHTML, '<div><p>Goodbye</p></div>' );
|
assert.htmlEqual(target.innerHTML, '<div><p>Goodbye</p></div>');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in new issue