mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
666 B
25 lines
666 B
8 years ago
|
export default {
|
||
|
html: '<div><p></p></div>',
|
||
8 years ago
|
|
||
8 years ago
|
test ( assert, component, target ) {
|
||
|
const widget = component.refs.widget;
|
||
8 years ago
|
|
||
8 years ago
|
assert.equal( widget.get( 'show' ), false );
|
||
8 years ago
|
|
||
8 years ago
|
widget.set({show: true});
|
||
8 years ago
|
assert.htmlEqual( target.innerHTML, '<div><p>Hello</p></div>' );
|
||
|
|
||
8 years ago
|
component.set({data: 'World'});
|
||
8 years ago
|
assert.htmlEqual( target.innerHTML, '<div><p>World</p></div>' );
|
||
|
|
||
8 years ago
|
widget.set({show: false});
|
||
8 years ago
|
assert.htmlEqual( target.innerHTML, '<div><p></p></div>' );
|
||
|
|
||
|
component.set({data: 'Goodbye'});
|
||
|
assert.htmlEqual( target.innerHTML, '<div><p></p></div>' );
|
||
|
|
||
|
widget.set({show: true});
|
||
|
assert.htmlEqual( target.innerHTML, '<div><p>Goodbye</p></div>' );
|
||
8 years ago
|
}
|
||
8 years ago
|
};
|