@@ -136,6 +136,7 @@ const POPUP_CONTENT_INHERIT_HEIGHT_CLASS = 'dx-popup-inherit-height';
136136const POPUP_BOTTOM_RIGHT_RESIZE_HANDLE_CLASS = 'dx-resizable-handle-corner-bottom-right' ;
137137const POPUP_TOP_LEFT_RESIZE_HANDLE_CLASS = 'dx-resizable-handle-corner-top-left' ;
138138const DISABLED_STATE_CLASS = 'dx-state-disabled' ;
139+ const TOOLBAR_ITEM_CONTENT_CLASS = 'dx-toolbar-item-content' ;
139140
140141const POPUP_DRAGGABLE_CLASS = 'dx-popup-draggable' ;
141142
@@ -2722,7 +2723,6 @@ QUnit.module('rendering', {
27222723 } ) ;
27232724 } ) ;
27242725
2725-
27262726 QUnit . test ( 'dx-popup-fullscreen-width class should be attached when width is equal to screen width' , function ( assert ) {
27272727 this . instance . option ( 'width' , function ( ) { return getWidth ( $ ( window ) ) ; } ) ;
27282728 this . instance . show ( ) ;
@@ -2748,6 +2748,39 @@ QUnit.module('rendering', {
27482748 assert . ok ( $ ( '.' + POPUP_BOTTOM_CLASS ) . dxToolbar ( 'instance' ) . option ( 'compactMode' ) , 'bottom toolbar has the compact option' ) ;
27492749 } ) ;
27502750
2751+ [ 'top' , 'bottom' ] . forEach ( ( position ) => {
2752+ QUnit . test ( `${ position } toolbar should be rendered correctly after clearing the toolbarItems (T1305512)` , function ( assert ) {
2753+ const popup = $ ( '#popup' ) . dxPopup ( {
2754+ showCloseButton : false ,
2755+ showTitle : false ,
2756+ } ) . dxPopup ( 'instance' ) ;
2757+
2758+ popup . option ( {
2759+ toolbarItems : [
2760+ {
2761+ text : 'first' ,
2762+ toolbar : position ,
2763+ } ,
2764+ ] ,
2765+ } ) ;
2766+ popup . option ( { toolbarItems : [ ] } ) ;
2767+ popup . option ( {
2768+ toolbarItems : [
2769+ {
2770+ text : 'second' ,
2771+ toolbar : position ,
2772+ } ,
2773+ ] ,
2774+ } ) ;
2775+
2776+ popup . show ( ) ;
2777+
2778+ const $toolbarItemContent = popup . $wrapper ( ) . find ( `.${ TOOLBAR_ITEM_CONTENT_CLASS } ` ) ;
2779+
2780+ assert . strictEqual ( $toolbarItemContent . text ( ) , 'second' , 'toolbar with the correct element rendered after toolbarItems cleaning' ) ;
2781+ } ) ;
2782+ } ) ;
2783+
27512784 QUnit . test ( 'dx-popup-content-scrollable class should be attached when preventScrollEvents is used' , function ( assert ) {
27522785 this . instance . show ( ) ;
27532786
0 commit comments