From 306a93117668fed893e2e6d88b025364ffa9e81f Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Sun, 4 Dec 2016 21:09:06 -0500 Subject: [PATCH] test update while yield fragment is torn down, and tweak code for consistency --- test/compiler/component-yield-if/Widget.html | 22 ++++++++++---------- test/compiler/component-yield-if/_config.js | 19 +++++++++++++---- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/test/compiler/component-yield-if/Widget.html b/test/compiler/component-yield-if/Widget.html index 7dbf91afb5..a2c8d49daa 100644 --- a/test/compiler/component-yield-if/Widget.html +++ b/test/compiler/component-yield-if/Widget.html @@ -1,15 +1,15 @@

- {{#if show}} - {{yield}} - {{/if}} + {{#if show}} + {{yield}} + {{/if}}

- diff --git a/test/compiler/component-yield-if/_config.js b/test/compiler/component-yield-if/_config.js index fad768230d..a428e4522d 100644 --- a/test/compiler/component-yield-if/_config.js +++ b/test/compiler/component-yield-if/_config.js @@ -1,13 +1,24 @@ export default { html: '

', + test ( assert, component, target ) { const widget = component.refs.widget; + assert.equal( widget.get( 'show' ), false ); + widget.set({show: true}); - assert.equal( target.innerHTML, '

Hello

' ); + assert.htmlEqual( target.innerHTML, '

Hello

' ); + component.set({data: 'World'}); - assert.equal( target.innerHTML, '

World

' ); + assert.htmlEqual( target.innerHTML, '

World

' ); + widget.set({show: false}); - assert.equal( target.innerHTML, '

' ); + assert.htmlEqual( target.innerHTML, '

' ); + + component.set({data: 'Goodbye'}); + assert.htmlEqual( target.innerHTML, '

' ); + + widget.set({show: true}); + assert.htmlEqual( target.innerHTML, '

Goodbye

' ); } -} +};