diff --git a/test/compiler/component-binding-nested/Bar.html b/test/compiler/component-binding-nested/Bar.html new file mode 100644 index 0000000000..7ad21f5627 --- /dev/null +++ b/test/compiler/component-binding-nested/Bar.html @@ -0,0 +1,12 @@ + +
bar x: {{x}}
+ +baz x: {{x}}
diff --git a/test/compiler/component-binding-nested/Foo.html b/test/compiler/component-binding-nested/Foo.html new file mode 100644 index 0000000000..6a693275a0 --- /dev/null +++ b/test/compiler/component-binding-nested/Foo.html @@ -0,0 +1,12 @@ + +foo x: {{x}}
+ +x: initial
+ +foo x: initial
+ +bar x: initial
+ +baz x: initial
+ `, + + test ( assert, component, target, window ) { + const click = new window.MouseEvent( 'click' ); + const buttons = [ ...target.querySelectorAll( 'button' ) ]; + + buttons[0].dispatchEvent( click ); + + assert.equal( component.get( 'x' ), 'p' ); + assert.htmlEqual( target.innerHTML, ` +x: p
+ +foo x: p
+ +bar x: p
+ +baz x: p
+ ` ); + + buttons[1].dispatchEvent( click ); + + assert.equal( component.get( 'x' ), 'q' ); + assert.htmlEqual( target.innerHTML, ` +x: q
+ +foo x: q
+ +bar x: q
+ +baz x: q
+ ` ); + + buttons[2].dispatchEvent( click ); + + assert.equal( component.get( 'x' ), 'r' ); + assert.htmlEqual( target.innerHTML, ` +x: r
+ +foo x: r
+ +bar x: r
+ +baz x: r
+ ` ); + } +}; diff --git a/test/compiler/component-binding-nested/main.html b/test/compiler/component-binding-nested/main.html new file mode 100644 index 0000000000..fa2d9dbc27 --- /dev/null +++ b/test/compiler/component-binding-nested/main.html @@ -0,0 +1,11 @@ +x: {{x}}
+ +