Skip to content

Commit

Permalink
Fix templatefinder test
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Moore committed Dec 10, 2015
1 parent f614fe6 commit 06c0faa
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/behavior_templatefindable.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<template>
<mm-template-finder template-finder="{{templateFinder}}" template-findable="{{templateFindable}}">
<content select="template"></content>
<template is="dom-template" id="internal">
<template preserve-content id="internal">
<test-stamping datum="{{obj}}"></test-stamping>
</template>
</mm-template-finder>
Expand All @@ -76,7 +76,7 @@

<dom-module id="test-patch">
<template>
<template is="dom-template" id="internal">
<template preserve-content id="internal">
<test-stamping datum="{{obj}}"></test-stamping>
</template>
<content></content>
Expand All @@ -93,11 +93,11 @@
</script>
</dom-module>

<template is="dom-bind" id="external2">
<template id="external2">
<test-stamping datum="{{obj}}"></test-stamping>
</template>

<template is="dom-template" id="external3">
<template id="external3">
<test-stamping datum="{{obj}}"></test-stamping>
</template>

Expand All @@ -110,16 +110,17 @@
<script>
describe("TemplateFindable", function() {

it("should propagate changes with custom behavior", function() {
it("should propagate changes without error", function() {
var element = document.querySelector("#test1");
var external = document.querySelector("#external2");
var instance = null;
var stamped = null;
var model = null;
var error = null;

instance = element.stampTemplate(model = {});
instance = element.instantiateTemplateInto(null);
instance.set("obj", { input: "text", });
instance.render(); // render() is necessary for deep paths to be set()

try {
instance.set("obj.input", "nothing");
Expand All @@ -134,16 +135,17 @@
element.set("templateFindable.templateSelector", "");
element.set("templateFindable.templateBind", external);

instance = element.cloneTemplate();
instance = element.instantiateTemplateInto(null);
instance.set("obj", { input: "text", });
instance.render(); // render() is necessary for deep paths to be set()

try {
instance.set("obj.input", "nothing");
} catch (e) {
error = error || e;
}

should.not.exist(error);
should.not.exist(error && error.stack);
});

});
Expand Down

0 comments on commit 06c0faa

Please sign in to comment.