|
55 | 55 | <div id="QuxSibling"></div>
|
56 | 56 | </template>
|
57 | 57 | </test-fixture>
|
| 58 | + <test-fixture id="CommentedSingleChildFixture"> |
| 59 | + <template> |
| 60 | + <!-- comment --> |
| 61 | + <!-- comment --> |
| 62 | + <div id="Foo"></div> |
| 63 | + <!-- comment --> |
| 64 | + </template> |
| 65 | + </test-fixture> |
| 66 | + <test-fixture id="CommentedMultiChildFixture"> |
| 67 | + <template> |
| 68 | + <!-- comment --> |
| 69 | + <div id="Bar"> |
| 70 | + <div id="BarChild"></div> |
| 71 | + </div> |
| 72 | + <!-- comment --> |
| 73 | + <!-- comment --> |
| 74 | + <div id="BarSibling"></div> |
| 75 | + <!-- comment --> |
| 76 | + <div id="Baz"></div> |
| 77 | + </template> |
| 78 | + </test-fixture> |
58 | 79 | <test-fixture id="AttachedFixture">
|
59 | 80 | <template>
|
60 | 81 | <x-custom></x-custom>
|
|
65 | 86 | var trivialFixture;
|
66 | 87 | var complexDomFixture;
|
67 | 88 | var multiTemplateFixture;
|
| 89 | + var commentedSingleChildFixture; |
| 90 | + var commentedMultiChildFixture; |
68 | 91 |
|
69 | 92 | beforeEach(function () {
|
70 | 93 | trivialFixture = document.getElementById('TrivialFixture');
|
71 | 94 | complexDomFixture = document.getElementById('ComplexDomFixture');
|
72 | 95 | multiTemplateFixture = document.getElementById('MultiTemplateFixture');
|
| 96 | + commentedSingleChildFixture = document.getElementById('CommentedSingleChildFixture'); |
| 97 | + commentedMultiChildFixture = document.getElementById('CommentedMultiChildFixture'); |
73 | 98 | });
|
74 | 99 |
|
75 | 100 | afterEach(function () {
|
76 | 101 | trivialFixture.restore();
|
77 | 102 | complexDomFixture.restore();
|
78 | 103 | multiTemplateFixture.restore();
|
| 104 | + commentedSingleChildFixture.restore(); |
| 105 | + commentedMultiChildFixture.restore(); |
79 | 106 | });
|
80 | 107 |
|
81 | 108 | describe('an stamped-out fixture', function () {
|
|
179 | 206 | expect(groups[1][1]).to.be.instanceOf(HTMLElement);
|
180 | 207 | });
|
181 | 208 | });
|
| 209 | + |
| 210 | + describe('when there are comments in the template', function() { |
| 211 | + var el; |
| 212 | + var els; |
| 213 | + |
| 214 | + beforeEach(function () { |
| 215 | + el = commentedSingleChildFixture.create(); |
| 216 | + els = commentedMultiChildFixture.create(); |
| 217 | + }); |
| 218 | + |
| 219 | + it('returns a single element if the template has a single child', function() { |
| 220 | + expect(el).to.be.instanceOf(HTMLElement); |
| 221 | + }); |
| 222 | + |
| 223 | + it('returns multiple elements if the template has multiple children', function() { |
| 224 | + expect(els).to.be.instanceOf(Array); |
| 225 | + expect(els.length).to.equal(3); |
| 226 | + }); |
| 227 | + }); |
182 | 228 | });
|
183 | 229 |
|
184 | 230 | describe('when the fixture global is called', function () {
|
|
0 commit comments