forked from Polymer/polymer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure template is decorated before stamping shadowRoot, fixes Polyme…
- Loading branch information
Showing
4 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<polymer-element name="decoration-test"> | ||
<template> | ||
<select id="select"> | ||
<option template repeat="{{opt in options}}" value="{{opt}}">{{opt}}</option> | ||
</select> | ||
</template> | ||
<script> | ||
Polymer('decoration-test', { | ||
options: [1, 2, 3, 4], | ||
ready: function() { | ||
this.test(); | ||
testsRun++; | ||
}, | ||
test: function() { | ||
chai.assert.equal(this.$.select.children.length, 5, 'attribute template stamped'); | ||
} | ||
}); | ||
</script> | ||
</polymer-element> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<!doctype html> | ||
<!-- | ||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | ||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
Code distributed by Google as part of the polymer project is also | ||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
--> | ||
<script src="../../../platform/platform.js"></script> | ||
<link rel="import" href="../../polymer.html"> | ||
<link rel="import" href="template-attr-template-import.html"> | ||
<script src="../../../tools/test/htmltest.js"></script> | ||
<script src="../../../tools/test/chai/chai.js"></script> | ||
<script> | ||
var testsRun = 0; | ||
</script> | ||
|
||
|
||
<polymer-element name="decoration-test2" extends="decoration-test"> | ||
<template> | ||
<table> | ||
<thead> | ||
<th>one</th> | ||
<th>two</th> | ||
<th>three</th> | ||
</thead> | ||
<tbody id="tbody"> | ||
<tr template repeat="{{ arr in arrs }}"> | ||
<td template repeat="{{ n in arr }}"> | ||
{{n}} | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</template> | ||
<script> | ||
Polymer('decoration-test2', { | ||
arrs: [ [1,2,3], [4,5,6] ], | ||
test: function() { | ||
chai.assert.equal(this.$.tbody.children.length, 3, 'attribute template stamped'); | ||
chai.assert.equal(this.$.tbody.children[1].children.length, 4, 'attribute sub-template stamped'); | ||
} | ||
}); | ||
</script> | ||
</polymer-element> | ||
|
||
<decoration-test></decoration-test> | ||
<br> | ||
<decoration-test2></decoration-test2> | ||
|
||
|
||
<script> | ||
document.addEventListener('polymer-ready', function() { | ||
chai.assert.equal(testsRun, 2, 'decration tests ran'); | ||
done(); | ||
}); | ||
</script> |
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