mirror of https://github.com/sveltejs/svelte
parent
66b6880d5b
commit
3586296a00
@ -1,13 +1,24 @@
|
||||
export default {
|
||||
html: '<div><p></p></div>',
|
||||
|
||||
test ( assert, component, target ) {
|
||||
const widget = component.refs.widget;
|
||||
|
||||
assert.equal( widget.get( 'show' ), false );
|
||||
|
||||
widget.set({show: true});
|
||||
assert.equal( target.innerHTML, '<div><p>Hello<!--yield--><!--#if show--></p></div>' );
|
||||
assert.htmlEqual( target.innerHTML, '<div><p>Hello</p></div>' );
|
||||
|
||||
component.set({data: 'World'});
|
||||
assert.equal( target.innerHTML, '<div><p>World<!--yield--><!--#if show--></p></div>' );
|
||||
assert.htmlEqual( target.innerHTML, '<div><p>World</p></div>' );
|
||||
|
||||
widget.set({show: false});
|
||||
assert.equal( target.innerHTML, '<div><p><!--#if show--></p></div>' );
|
||||
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>' );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in new issue