@@ -264,6 +264,36 @@ suite('Polymer.dom', function() {
264
264
assert . deepEqual ( Polymer . dom ( ec2 ) . getDistributedNodes ( ) , [ ] ) ;
265
265
} ) ;
266
266
267
+ test ( 'without a host setting hostAttributes/reflecting properties provokes distribution' , function ( ) {
268
+ var e = document . querySelector ( 'x-select-attr' ) ;
269
+ var ip$ = Polymer . dom ( e . root ) . querySelectorAll ( 'content' ) ;
270
+ var c = Polymer . dom ( e ) . firstElementChild ;
271
+ assert . equal ( Polymer . dom ( c ) . getDestinationInsertionPoints ( ) [ 0 ] , ip$ [ 1 ] , 'child not distributed based on host attribute' ) ;
272
+ c . foo = true ;
273
+ Polymer . dom . flush ( ) ;
274
+ assert . equal ( Polymer . dom ( c ) . getDestinationInsertionPoints ( ) [ 0 ] , ip$ [ 0 ] , 'child not distributed based on reflecting attribute' )
275
+ c . foo = false ;
276
+ Polymer . dom . flush ( ) ;
277
+ assert . equal ( Polymer . dom ( c ) . getDestinationInsertionPoints ( ) [ 0 ] , ip$ [ 1 ] , 'child not distributed based on reflecting attribute' )
278
+ } ) ;
279
+
280
+ test ( 'within a host setting hostAttributes/reflecting properties provokes distribution' , function ( ) {
281
+ var e = document . querySelector ( 'x-compose-select-attr' ) ;
282
+ var ip$ = Polymer . dom ( e . $ . select . root ) . querySelectorAll ( 'content' ) ;
283
+ var c1 = e . $ . attr1 ;
284
+ Polymer . dom . flush ( ) ;
285
+ assert . equal ( Polymer . dom ( c1 ) . getDestinationInsertionPoints ( ) [ 0 ] , ip$ [ 1 ] , 'child not distributed based on host attribute' ) ;
286
+ c1 . foo = true ;
287
+ Polymer . dom . flush ( ) ;
288
+ assert . equal ( Polymer . dom ( c1 ) . getDestinationInsertionPoints ( ) [ 0 ] , ip$ [ 0 ] , 'child not distributed based on reflecting attribute' )
289
+ c1 . foo = false ;
290
+ Polymer . dom . flush ( ) ;
291
+ assert . equal ( Polymer . dom ( c1 ) . getDestinationInsertionPoints ( ) [ 0 ] , ip$ [ 1 ] , 'child not distributed based on reflecting attribute' )
292
+ var c2 = e . $ . attr2 ;
293
+ Polymer . dom . flush ( ) ;
294
+ assert . equal ( Polymer . dom ( c2 ) . getDestinationInsertionPoints ( ) [ 0 ] , ip$ [ 0 ] , 'child not distributed based on default value' ) ;
295
+ } ) ;
296
+
267
297
test ( 'appendChild (light)' , function ( ) {
268
298
var rere = Polymer . dom ( testElement . root ) . querySelector ( 'x-rereproject' ) ;
269
299
var s = document . createElement ( 'span' ) ;
0 commit comments