|
191 | 191 | assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3 display wrong');
|
192 | 192 | });
|
193 | 193 |
|
194 |
| - test('hide 3', function() { |
195 |
| - individual.shouldStamp3 = false; |
| 194 | + test('show 4', function() { |
| 195 | + individual.shouldStamp4 = true; |
| 196 | + individual.render(); |
| 197 | + let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)'); |
| 198 | + assert.equal(stamped.length, 4, 'total stamped count incorrect'); |
| 199 | + assert.equal(stamped[0].prop, 'prop1'); |
| 200 | + assert.equal(stamped[1].prop, 'prop2'); |
| 201 | + assert.equal(stamped[2].prop, 'prop3'); |
| 202 | + assert.equal(stamped[3].prop, 'prop4'); |
| 203 | + assert.equal(getComputedStyle(stamped[0]).display, 'inline', 'stamped 1 display wrong'); |
| 204 | + assert.equal(getComputedStyle(stamped[1]).display, 'inline', 'stamped 2 display wrong'); |
| 205 | + assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3 display wrong'); |
| 206 | + assert.equal(getComputedStyle(stamped[3]).display, 'inline', 'stamped 4 display wrong'); |
| 207 | + }); |
| 208 | + |
| 209 | + test('remove 4', function() { |
| 210 | + individual.shouldStamp4 = false; |
| 211 | + individual.render(); |
| 212 | + let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)'); |
| 213 | + assert.equal(stamped.length, 3, 'total stamped count incorrect'); |
| 214 | + assert.equal(stamped[0].prop, 'prop1'); |
| 215 | + assert.equal(stamped[1].prop, 'prop2'); |
| 216 | + assert.equal(stamped[2].prop, 'prop3'); |
| 217 | + assert.equal(getComputedStyle(stamped[0]).display, 'inline', 'stamped 1 display wrong'); |
| 218 | + assert.equal(getComputedStyle(stamped[1]).display, 'inline', 'stamped 2 display wrong'); |
| 219 | + assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3 display wrong'); |
| 220 | + }); |
| 221 | + |
| 222 | + test('show 5', function() { |
| 223 | + individual.shouldStamp5 = true; |
| 224 | + individual.render(); |
| 225 | + let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)'); |
| 226 | + assert.equal(stamped.length, 4, 'total stamped count incorrect'); |
| 227 | + assert.equal(stamped[0].prop, 'prop1'); |
| 228 | + assert.equal(stamped[1].prop, 'prop2'); |
| 229 | + assert.equal(stamped[2].prop, 'prop3'); |
| 230 | + assert.equal(stamped[3].prop, 'prop5'); |
| 231 | + assert.equal(getComputedStyle(stamped[0]).display, 'inline', 'stamped 1 display wrong'); |
| 232 | + assert.equal(getComputedStyle(stamped[1]).display, 'inline', 'stamped 2 display wrong'); |
| 233 | + assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3 display wrong'); |
| 234 | + assert.equal(getComputedStyle(stamped[3]).display, 'inline', 'stamped 5 display wrong'); |
| 235 | + }); |
| 236 | + |
| 237 | + test('update 5', function() { |
| 238 | + individual.prop5 = 'prop5*'; |
| 239 | + let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)'); |
| 240 | + assert.equal(stamped.length, 4, 'total stamped count incorrect'); |
| 241 | + assert.equal(stamped[0].prop, 'prop1'); |
| 242 | + assert.equal(stamped[1].prop, 'prop2'); |
| 243 | + assert.equal(stamped[2].prop, 'prop3'); |
| 244 | + assert.equal(stamped[3].prop, 'prop5*'); |
| 245 | + }); |
| 246 | + |
| 247 | + test('remove 5', function() { |
| 248 | + individual.shouldStamp5 = false; |
196 | 249 | individual.render();
|
197 | 250 | let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)');
|
198 | 251 | assert.equal(stamped.length, 3, 'total stamped count incorrect');
|
| 252 | + assert.equal(stamped[0].prop, 'prop1'); |
| 253 | + assert.equal(stamped[1].prop, 'prop2'); |
| 254 | + assert.equal(stamped[2].prop, 'prop3'); |
| 255 | + assert.equal(getComputedStyle(stamped[0]).display, 'inline', 'stamped 1 display wrong'); |
| 256 | + assert.equal(getComputedStyle(stamped[1]).display, 'inline', 'stamped 2 display wrong'); |
| 257 | + assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3 display wrong'); |
| 258 | + }); |
| 259 | + |
| 260 | + test('remove 3', function() { |
| 261 | + individual.shouldStamp3 = false; |
| 262 | + individual.render(); |
| 263 | + let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)'); |
| 264 | + assert.equal(stamped.length, 2, 'total stamped count incorrect'); |
| 265 | + assert.equal(stamped[0].prop, 'prop1'); |
| 266 | + assert.equal(stamped[1].prop, 'prop2'); |
199 | 267 | assert.equal(getComputedStyle(stamped[0]).display, 'inline', 'stamped 1 display wrong');
|
200 | 268 | assert.equal(getComputedStyle(stamped[1]).display, 'inline', 'stamped 2 display wrong');
|
201 |
| - assert.equal(getComputedStyle(stamped[2]).display, 'none', 'stamped 3 display wrong'); |
202 | 269 | });
|
203 | 270 |
|
204 | 271 | test('hide 2', function() {
|
205 | 272 | individual.shouldStamp2 = false;
|
206 | 273 | individual.render();
|
207 | 274 | let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)');
|
208 |
| - assert.equal(stamped.length, 3, 'total stamped count incorrect'); |
| 275 | + assert.equal(stamped.length, 2, 'total stamped count incorrect'); |
209 | 276 | assert.equal(getComputedStyle(stamped[0]).display, 'inline', 'stamped 1 display wrong');
|
210 | 277 | assert.equal(getComputedStyle(stamped[1]).display, 'none', 'stamped 2 display wrong');
|
211 |
| - assert.equal(getComputedStyle(stamped[2]).display, 'none', 'stamped 3 display wrong'); |
212 | 278 | });
|
213 | 279 |
|
214 | 280 | test('hide 1', function() {
|
215 | 281 | individual.shouldStamp1 = false;
|
216 | 282 | individual.render();
|
217 | 283 | let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)');
|
218 |
| - assert.equal(stamped.length, 3, 'total stamped count incorrect'); |
| 284 | + assert.equal(stamped.length, 2, 'total stamped count incorrect'); |
219 | 285 | assert.equal(getComputedStyle(stamped[0]).display, 'none', 'stamped 1 display wrong');
|
220 | 286 | assert.equal(getComputedStyle(stamped[1]).display, 'none', 'stamped 2 display wrong');
|
221 |
| - assert.equal(getComputedStyle(stamped[2]).display, 'none', 'stamped 3 display wrong'); |
222 | 287 | });
|
223 | 288 |
|
224 | 289 | test('show 1', function() {
|
225 | 290 | individual.shouldStamp1 = true;
|
226 | 291 | individual.render();
|
227 | 292 | let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)');
|
228 |
| - assert.equal(stamped.length, 3, 'total stamped count incorrect'); |
| 293 | + assert.equal(stamped.length, 2, 'total stamped count incorrect'); |
229 | 294 | assert.equal(getComputedStyle(stamped[0]).display, 'inline', 'stamped 1 display wrong');
|
230 | 295 | assert.equal(getComputedStyle(stamped[1]).display, 'none', 'stamped 2 display wrong');
|
231 |
| - assert.equal(getComputedStyle(stamped[2]).display, 'none', 'stamped 3 display wrong'); |
232 | 296 | });
|
233 | 297 |
|
234 | 298 | test('show 2', function() {
|
235 | 299 | individual.shouldStamp2 = true;
|
236 | 300 | individual.render();
|
237 | 301 | let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)');
|
238 |
| - assert.equal(stamped.length, 3, 'total stamped count incorrect'); |
| 302 | + assert.equal(stamped.length, 2, 'total stamped count incorrect'); |
239 | 303 | assert.equal(getComputedStyle(stamped[0]).display, 'inline', 'stamped 1 display wrong');
|
240 | 304 | assert.equal(getComputedStyle(stamped[1]).display, 'inline', 'stamped 2 display wrong');
|
241 |
| - assert.equal(getComputedStyle(stamped[2]).display, 'none', 'stamped 3 display wrong'); |
242 | 305 | });
|
243 | 306 |
|
244 | 307 | test('show 3', function() {
|
|
0 commit comments