diff --git a/test/runtime/samples/component-binding-private-state/Bar.html b/test/runtime/samples/component-binding-private-state/Bar.html new file mode 100644 index 0000000000..3b5619a62d --- /dev/null +++ b/test/runtime/samples/component-binding-private-state/Bar.html @@ -0,0 +1,5 @@ + + +

Bar: {x}

\ No newline at end of file diff --git a/test/runtime/samples/component-binding-private-state/Foo.html b/test/runtime/samples/component-binding-private-state/Foo.html new file mode 100644 index 0000000000..1d899739d5 --- /dev/null +++ b/test/runtime/samples/component-binding-private-state/Foo.html @@ -0,0 +1,5 @@ + + +

Foo: {x}

\ No newline at end of file diff --git a/test/runtime/samples/component-binding-private-state/_config.js b/test/runtime/samples/component-binding-private-state/_config.js new file mode 100644 index 0000000000..bd8a25d490 --- /dev/null +++ b/test/runtime/samples/component-binding-private-state/_config.js @@ -0,0 +1,31 @@ +export default { + html: ` +

Foo: yes

+

x in parent: undefined

+ `, + + async test({ assert, component, target, window }) { + component.a = false; + + assert.htmlEqual(target.innerHTML, ` +

Bar: no

+

x in parent: undefined

+ `); + + component.a = true; + assert.equal(component.x, undefined); + component.x = 'maybe'; + + assert.htmlEqual(target.innerHTML, ` +

Foo: yes

+

x in parent: maybe

+ `); + + component.a = false; + + assert.htmlEqual(target.innerHTML, ` +

Bar: no

+

x in parent: maybe

+ `); + } +}; diff --git a/test/runtime/samples/component-binding-private-state/main.html b/test/runtime/samples/component-binding-private-state/main.html new file mode 100644 index 0000000000..ffc5bd188d --- /dev/null +++ b/test/runtime/samples/component-binding-private-state/main.html @@ -0,0 +1,11 @@ + + + + +

x in parent: {x}

\ No newline at end of file