Skip to content

Commit 06c0faa

Browse files
author
Justin Moore
committed
Fix templatefinder test
1 parent f614fe6 commit 06c0faa

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

test/behavior_templatefindable.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<template>
5555
<mm-template-finder template-finder="{{templateFinder}}" template-findable="{{templateFindable}}">
5656
<content select="template"></content>
57-
<template is="dom-template" id="internal">
57+
<template preserve-content id="internal">
5858
<test-stamping datum="{{obj}}"></test-stamping>
5959
</template>
6060
</mm-template-finder>
@@ -76,7 +76,7 @@
7676

7777
<dom-module id="test-patch">
7878
<template>
79-
<template is="dom-template" id="internal">
79+
<template preserve-content id="internal">
8080
<test-stamping datum="{{obj}}"></test-stamping>
8181
</template>
8282
<content></content>
@@ -93,11 +93,11 @@
9393
</script>
9494
</dom-module>
9595

96-
<template is="dom-bind" id="external2">
96+
<template id="external2">
9797
<test-stamping datum="{{obj}}"></test-stamping>
9898
</template>
9999

100-
<template is="dom-template" id="external3">
100+
<template id="external3">
101101
<test-stamping datum="{{obj}}"></test-stamping>
102102
</template>
103103

@@ -110,16 +110,17 @@
110110
<script>
111111
describe("TemplateFindable", function() {
112112

113-
it("should propagate changes with custom behavior", function() {
113+
it("should propagate changes without error", function() {
114114
var element = document.querySelector("#test1");
115115
var external = document.querySelector("#external2");
116116
var instance = null;
117117
var stamped = null;
118118
var model = null;
119119
var error = null;
120120

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

124125
try {
125126
instance.set("obj.input", "nothing");
@@ -134,16 +135,17 @@
134135
element.set("templateFindable.templateSelector", "");
135136
element.set("templateFindable.templateBind", external);
136137

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

140142
try {
141143
instance.set("obj.input", "nothing");
142144
} catch (e) {
143145
error = error || e;
144146
}
145147

146-
should.not.exist(error);
148+
should.not.exist(error && error.stack);
147149
});
148150

149151
});

0 commit comments

Comments
 (0)