Created
June 20, 2014 01:04
-
-
Save esprehn/1f80d17709b34eb66187 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<polymer-test name="my-widget-tests"> | |
<template> | |
<my-widget object="{{ object }}"></my-widget> | |
</template> | |
<script> | |
PolymerTest("my-widget-tests", { | |
setup: function(data) { | |
// Setup data binding for each test. | |
data.object = {someValue: 2}; | |
}, | |
"should load data": function(widget) { | |
assert.equal(widget.computedProperty, 2); | |
assert.equal(widget.shadowRoot.firstChild.textContent, "My value is 2"); | |
} | |
"should handle dynamic changes": function(widget, data, done) { | |
data.object = {someValue: 5}; | |
endOfMicrotask(function() { | |
assert.equal(widget.computedProperty, 5); | |
assert.equal(widget.shadowRoot.firstChild.textContent, "My value is 5"); | |
done(); | |
}); | |
} | |
}) | |
</script> | |
</polymer-test> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment