@@ -425,6 +425,24 @@ describe('Generators - Template', () => {
425425 expect ( expression [ BINDING_IS_BOOLEAN_ATTRIBUTE ] ) . to . be . equal ( false )
426426 } )
427427
428+ it ( 'Custom boolean attribute without value on a child node' , ( ) => {
429+ const source = '<parent><my-tag enabled></my-tag></parent>'
430+ const { template } = parse ( source )
431+ const [ , bindings ] = builder (
432+ createRootNode ( template ) ,
433+ FAKE_SRC_FILE ,
434+ source ,
435+ )
436+ const output = evaluateOutput ( bindings [ 0 ] )
437+ const expression = output . attributes [ 0 ]
438+
439+ expect ( expression [ BINDING_EVALUATE_KEY ] ( ) ) . to . be . equal ( '' )
440+ expect ( expression [ BINDING_TYPE_KEY ] ) . to . be . equal (
441+ expressionTypes . ATTRIBUTE ,
442+ )
443+ expect ( expression [ BINDING_IS_BOOLEAN_ATTRIBUTE ] ) . to . be . equal ( false )
444+ } )
445+
428446 it ( 'Known boolean attribute on a child node' , ( ) => {
429447 const source = '<my-tag><input checked={undefined}/></my-tag>'
430448 const { template } = parse ( source )
@@ -956,7 +974,7 @@ describe('Generators - Template', () => {
956974 expect ( output [ BINDING_TYPE_KEY ] ) . to . be . equal ( bindingTypes . TAG )
957975 expect ( output [ BINDING_EVALUATE_KEY ] ( ) ) . to . be . equal ( 'my-tag' )
958976 expect ( defaultSlot [ BINDING_HTML_KEY ] ) . to . be . equal (
959- '<slot expr34="expr34 " name="default" slot="default"></slot>' ,
977+ '<slot expr35="expr35 " name="default" slot="default"></slot>' ,
960978 )
961979 expect ( defaultSlot [ BINDING_ID_KEY ] ) . to . be . equal ( 'default' )
962980 } )
0 commit comments