@@ -43,6 +43,8 @@ import {
4343 FORM_LOAD_PANEL_WRAPPER_CLASS
4444} from '__internal/ui/form/constants' ;
4545
46+ import { FORM_LOAD_INDICATOR_SIZE } from '__internal/ui/form/form.load_panel' ;
47+
4648import {
4749 GET_LABEL_WIDTH_BY_TEXT_CLASS ,
4850 FIELD_ITEM_OPTIONAL_MARK_CLASS ,
@@ -5349,16 +5351,27 @@ QUnit.module('LoadIndicator', () => {
53495351 const $loadPanel = form . $element ( ) . find ( `.${ FORM_LOAD_PANEL_CLASS } ` ) ;
53505352 const loadPanelInstance = $loadPanel . data ( 'dxLoadPanel' ) ;
53515353
5352- assert . strictEqual ( loadPanelInstance . option ( 'visible' ) , true , 'LoadPanel is visible' ) ;
5353- assert . strictEqual ( loadPanelInstance . option ( 'showIndicator' ) , true , 'LoadPanel shows indicator' ) ;
5354- assert . strictEqual ( loadPanelInstance . option ( 'showPane' ) , false , 'LoadPanel does not show pane' ) ;
5355- assert . strictEqual ( loadPanelInstance . option ( 'shading' ) , false , 'LoadPanel does not show shading' ) ;
5356- assert . strictEqual ( loadPanelInstance . option ( 'hideOnOutsideClick' ) , false , 'LoadPanel does not hide on outside click' ) ;
5357- assert . strictEqual ( loadPanelInstance . option ( 'hideOnParentScroll' ) , false , 'LoadPanel does not hide on parent scroll' ) ;
5358- assert . strictEqual ( loadPanelInstance . option ( 'deferRendering' ) , false , 'LoadPanel does not defer rendering' ) ;
5359- assert . strictEqual ( loadPanelInstance . option ( 'disabled' ) , false , 'LoadPanel is not disabled' ) ;
5360- assert . strictEqual ( loadPanelInstance . option ( 'message' ) , '' , 'LoadPanel has empty message' ) ;
5361- assert . strictEqual ( loadPanelInstance . option ( 'wrapperAttr.class' ) , FORM_LOAD_PANEL_WRAPPER_CLASS , 'LoadPanel has correct wrapper class' ) ;
5354+
5355+ const expectedOptions = {
5356+ visible : true ,
5357+ showIndicator : true ,
5358+ showPane : false ,
5359+ shading : false ,
5360+ hideOnOutsideClick : false ,
5361+ hideOnParentScroll : false ,
5362+ deferRendering : false ,
5363+ disabled : false ,
5364+ message : '' ,
5365+ 'wrapperAttr.class' : FORM_LOAD_PANEL_WRAPPER_CLASS ,
5366+ width : FORM_LOAD_INDICATOR_SIZE ,
5367+ height : FORM_LOAD_INDICATOR_SIZE ,
5368+ maxWidth : undefined ,
5369+ maxHeight : undefined
5370+ } ;
5371+
5372+ Object . entries ( expectedOptions ) . forEach ( ( [ optionName , value ] ) => {
5373+ assert . strictEqual ( loadPanelInstance . option ( optionName ) , value , `${ optionName } option has correct default value` ) ;
5374+ } ) ;
53625375 } ) ;
53635376
53645377 QUnit . test ( 'LoadPanel has correct positioning relative to form' , function ( assert ) {
@@ -5448,9 +5461,12 @@ QUnit.module('LoadIndicator', () => {
54485461 assert . strictEqual ( form . option ( 'disabled' ) , true , 'Form is disabled during operation' ) ;
54495462
54505463 clock . tick ( 150 ) ;
5464+
54515465 assert . strictEqual ( form . $element ( ) . find ( `.${ FORM_LOAD_PANEL_CLASS } ` ) . length , 1 , 'LoadPanel is still present but hidden' ) ;
5466+
54525467 const $loadPanel = form . $element ( ) . find ( `.${ FORM_LOAD_PANEL_CLASS } ` ) ;
54535468 const loadPanelInstance = $loadPanel . data ( 'dxLoadPanel' ) ;
5469+
54545470 assert . strictEqual ( loadPanelInstance . option ( 'visible' ) , false , 'LoadPanel is hidden after operation' ) ;
54555471 assert . strictEqual ( form . option ( 'disabled' ) , false , 'Form is enabled after operation' ) ;
54565472
0 commit comments