@@ -290,6 +290,41 @@ QUnit.module('render', moduleConfig, () => {
290290 assert . strictEqual ( this . overflowMenu . $popupContent ( ) . closest ( $container ) . length , 1 , 'Popover content located into desired container' ) ;
291291 } ) ;
292292
293+ QUnit . test ( 'popup should have correct height after async item templates are rendered (T1322123)' , function ( assert ) {
294+ const templateRenderingTimeout = 10 ;
295+ const itemHeight = 50 ;
296+
297+ this . instance . option ( {
298+ items : [ 1 , 2 , 3 ] ,
299+ templatesRenderAsynchronously : true ,
300+ integrationOptions : {
301+ templates : {
302+ 'item' : {
303+ render ( { model, container, onRendered } ) {
304+ setTimeout ( ( ) => {
305+ const $item = $ ( `<div>${ model } </div>` ) ;
306+ $item . css ( 'height' , itemHeight ) ;
307+ $item . appendTo ( container ) ;
308+
309+ onRendered ( ) ;
310+ } , templateRenderingTimeout ) ;
311+ }
312+ }
313+ }
314+ } ,
315+ } ) ;
316+
317+ this . overflowMenu . click ( ) ;
318+
319+ this . clock . tick ( templateRenderingTimeout ) ;
320+
321+ const $overlayContent = this . overflowMenu . popup ( ) . $overlayContent ( ) ;
322+ const overlayContentHeight = getOuterHeight ( $overlayContent ) ;
323+
324+ assert . strictEqual ( this . overflowMenu . $items ( ) . length , 3 , 'all items are rendered' ) ;
325+ assert . strictEqual ( overlayContentHeight , 197 , 'popup height is updated' ) ;
326+ } ) ;
327+
293328 QUnit . test ( 'popup should be placed into new container after changing the container option' , function ( assert ) {
294329 const $container = $ ( '#dropDownMenu' ) ;
295330
0 commit comments