Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Unified Diff: sky/tests/framework/templates.sky

Issue 868973002: Don't set expression attributes before they're bound. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/framework/sky-element/sky-element.sky ('k') | sky/tests/framework/templates-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tests/framework/templates.sky
diff --git a/sky/tests/framework/templates.sky b/sky/tests/framework/templates.sky
index 747d9067bff71d70b43f2a2a51e799493b0bb11b..99047f017d88d07ad238917afaa5b2444bfd30d5 100644
--- a/sky/tests/framework/templates.sky
+++ b/sky/tests/framework/templates.sky
@@ -1,12 +1,28 @@
<sky>
<import src="/sky/tests//resources/chai.sky" />
<import src="/sky/tests/resources/mocha.sky" />
+<import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" />
<import src="/sky/tests/resources/test-element.sky" as="TestElement" />
<div id="sandbox"></div>
<test-element id="parser-element" checked="true" size="10" name="foo bar" />
+<sky-element name="test-element-parent">
+ <template>
+ <test-element size="{{ size }}" />
+ </template>
+ <script>
+ (class extends SkyElement {
+ created() {
+ this.size = 10;
+ }
+ }).register();
+ </script>
+</sky-element>
+
+<test-element-parent id="parent" />
+
<script>
describe("SkyElement", function() {
var element;
@@ -187,6 +203,14 @@ describe("SkyElement", function() {
assert.equal(element.lastEvent, event);
});
+ it("should not call attributeChanged for binding expression values", function() {
+ var parent = document.getElementById('parent');
+ var element = parent.shadowRoot.querySelector('test-element');
+ assert.deepEqual(element.changes, [
+ { name: 'size', oldValue: 0, newValue: 10 },
+ ]);
+ });
+
it("should call shadowRootReady after creating the template instance", function() {
assert.equal(element.shadowRootReadyCount, 0);
sandbox.appendChild(element);
« no previous file with comments | « sky/framework/sky-element/sky-element.sky ('k') | sky/tests/framework/templates-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698