Index: sky/tests/framework/templates.sky |
diff --git a/sky/tests/framework/templates.sky b/sky/tests/framework/templates.sky |
index aca46d80f4473f5b34c26c98c3c63e6c823d71b1..747d9067bff71d70b43f2a2a51e799493b0bb11b 100644 |
--- a/sky/tests/framework/templates.sky |
+++ b/sky/tests/framework/templates.sky |
@@ -131,6 +131,43 @@ describe("SkyElement", function() { |
}); |
}); |
+ it("should two way bind attributes", function(done) { |
+ sandbox.appendChild(element); |
+ var checkbox = element.shadowRoot.getElementById("checkbox"); |
+ assert.isFalse(checkbox.checked); |
+ assert.isFalse(element.checked); |
+ element.checked = true; |
+ assert.isTrue(element.checked); |
+ assert.isFalse(checkbox.checked); |
+ Promise.resolve().then(function() { |
+ assert.isTrue(checkbox.checked); |
+ checkbox.checked = false; |
+ assert.isFalse(checkbox.checked); |
+ return Promise.resolve().then(function() { |
+ assert.isFalse(element.checked); |
+ assert.isFalse(checkbox.checked); |
+ checkbox.checked = true; |
+ assert.isTrue(checkbox.checked); |
+ return Promise.resolve().then(function() { |
+ assert.isTrue(element.checked); |
+ element.checked = true; |
+ assert.isTrue(element.checked); |
+ assert.isTrue(checkbox.checked); |
+ element.checked = false; |
+ assert.isFalse(element.checked); |
+ assert.isTrue(checkbox.checked); |
+ return Promise.resolve().then(function() { |
+ assert.isFalse(checkbox.checked); |
+ assert.isFalse(element.checked); |
+ done(); |
+ }); |
+ }); |
+ }); |
+ }).catch(function(e) { |
+ done(e); |
+ }); |
+ }); |
+ |
it("should connect template event handlers", function() { |
sandbox.appendChild(element); |
var inside = element.shadowRoot.getElementById("inside"); |
@@ -160,4 +197,4 @@ describe("SkyElement", function() { |
}); |
}); |
</script> |
-</sky> |
+</sky> |