@@ -1607,6 +1607,47 @@ QUnit.module('Pane visibility', moduleConfig, () => {
16071607 } ) ;
16081608} ) ;
16091609
1610+ QUnit . module ( 'Pane.template' , moduleConfig , ( ) => {
1611+ QUnit . test ( 'ResizeHandle should not be duplicated when changing the template option at runtime (T1279224)' , function ( assert ) {
1612+ const firstPaneTemplate = ( ) => $ ( '<div>' ) . text ( 'Pane 1' ) ;
1613+ const secondPaneTemplate = ( ) => $ ( '<div>' ) . text ( 'Pane 2' ) ;
1614+
1615+ this . reinit ( {
1616+ dataSource : [ {
1617+ template : firstPaneTemplate
1618+ } , {
1619+ template : secondPaneTemplate
1620+ } ]
1621+ } ) ;
1622+
1623+ this . instance . option ( {
1624+ 'items[0].template' : secondPaneTemplate ,
1625+ 'items[1].template' : firstPaneTemplate ,
1626+ } ) ;
1627+
1628+ assert . strictEqual ( this . getResizeHandles ( ) . length , 1 ) ;
1629+ } ) ;
1630+
1631+ QUnit . test ( 'Layout should restore the distribution when changing the template option at runtime (T1279224)' , function ( assert ) {
1632+ const firstPaneTemplate = ( ) => $ ( '<div>' ) . text ( 'Pane 1' ) ;
1633+ const secondPaneTemplate = ( ) => $ ( '<div>' ) . text ( 'Pane 2' ) ;
1634+
1635+ this . reinit ( {
1636+ dataSource : [ {
1637+ size : '300px' ,
1638+ template : firstPaneTemplate
1639+ } , {
1640+ template : secondPaneTemplate
1641+ } ]
1642+ } ) ;
1643+
1644+ this . instance . option ( 'items[0].template' , secondPaneTemplate ) ;
1645+
1646+ this . checkItemSizes ( [ 300 , 692 ] ) ;
1647+ this . assertLayout ( [ '30.2419' , '69.7581' ] ) ;
1648+ } ) ;
1649+ } ) ;
1650+
16101651QUnit . module ( 'Resizing' , moduleConfig , ( ) => {
16111652 [ 'horizontal' , 'vertical' ] . forEach ( orientation => {
16121653 QUnit . test ( `collapsed pane should move its neighboring pane on expansion to left, orientation ${ orientation } ` , function ( assert ) {
@@ -2931,6 +2972,24 @@ QUnit.module('Visibility of control elements', {
29312972 } ) ;
29322973 } ) ;
29332974 } ) ;
2975+
2976+ QUnit . test ( 'ResizeHandle control elements visibility should be updated when changing the template option at runtime (T1279224)' , function ( assert ) {
2977+ const firstPaneTemplate = ( ) => $ ( '<div>' ) . text ( 'Pane 1' ) ;
2978+ const secondPaneTemplate = ( ) => $ ( '<div>' ) . text ( 'Pane 2' ) ;
2979+
2980+ this . reinit ( {
2981+ dataSource : [ {
2982+ template : firstPaneTemplate
2983+ } , {
2984+ template : secondPaneTemplate ,
2985+ collapsible : true ,
2986+ } ]
2987+ } ) ;
2988+
2989+ this . instance . option ( 'items[0].template' , secondPaneTemplate ) ;
2990+
2991+ this . checkIconsVisibility ( [ { prev : false , resize : true , next : true } ] ) ;
2992+ } ) ;
29342993} ) ;
29352994
29362995QUnit . module ( 'Events' , moduleConfig , ( ) => {
0 commit comments