Skip to content

Commit

Permalink
Test added
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Feb 5, 2016
1 parent 669f7be commit 8040988
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
26 changes: 25 additions & 1 deletion test/unit/configure-elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,28 @@

});
</script>
</dom-module>
</dom-module>

<script>
Polymer({
is: 'x-configure-internal',
properties: {
shouldChange : {
observer: 'shouldChangeCallback',
type: String
}
},
shouldChangeCallback: function() {
this.innerHTML = this.shouldChange;
}
});
</script>
<script>
Polymer({
is: 'x-configure-external',
ready: function() {
var e = this.querySelector('x-configure-internal');
e.shouldChange = 'It works';
}
});
</script>
14 changes: 11 additions & 3 deletions test/unit/configure.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@

<x-configure-value content="attr" object='{"foo": "obj-attr"}'></x-configure-value>

<x-configure-host></x-configure-host>
<x-configure-host></x-configure-host>

<x-configure-host content="attr"></x-configure-host>
<x-configure-host content="attr"></x-configure-host>

<x-configure-external>
<x-configure-internal></x-configure-internal>
</x-configure-external>

<script>

Expand Down Expand Up @@ -53,7 +57,7 @@

test('value set in properties initializes correctly', function() {
var e = document.querySelector('x-configure-value');
testConfigure(e, 'default', 'obj-default');
testConfigure(e, 'default', 'obj-default');
});

test('attribute overrides value set in properties', function() {
Expand Down Expand Up @@ -81,6 +85,10 @@
assert.equal(e.readOnly, 'default');
});

test('direct property assignment overrides getters and setters', function() {
var e = document.querySelector('x-configure-internal');
assert.equal(e.innerHTML, 'It works');
});
});

</script>
Expand Down

0 comments on commit 8040988

Please sign in to comment.