@@ -336,6 +336,69 @@ describe('MatDialog', () => {
336
336
expect ( overlayPane . style . height ) . toBe ( '100px' ) ;
337
337
} ) ;
338
338
339
+ it ( 'should should override the min-width of the overlay pane' , ( ) => {
340
+ dialog . open ( PizzaMsg , {
341
+ minWidth : '500px'
342
+ } ) ;
343
+
344
+ viewContainerFixture . detectChanges ( ) ;
345
+
346
+ let overlayPane = overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
347
+
348
+ expect ( overlayPane . style . minWidth ) . toBe ( '500px' ) ;
349
+ } ) ;
350
+
351
+ it ( 'should should override the max-width of the overlay pane' , fakeAsync ( ( ) => {
352
+ let dialogRef = dialog . open ( PizzaMsg ) ;
353
+
354
+ viewContainerFixture . detectChanges ( ) ;
355
+
356
+ let overlayPane = overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
357
+
358
+ expect ( overlayPane . style . maxWidth ) . toBe ( '80vw' ,
359
+ 'Expected dialog to set a default max-width on overlay pane' ) ;
360
+
361
+ dialogRef . close ( ) ;
362
+
363
+ tick ( 500 ) ;
364
+ viewContainerFixture . detectChanges ( ) ;
365
+ flushMicrotasks ( ) ;
366
+
367
+ dialogRef = dialog . open ( PizzaMsg , {
368
+ maxWidth : '100px'
369
+ } ) ;
370
+
371
+ viewContainerFixture . detectChanges ( ) ;
372
+
373
+ overlayPane = overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
374
+
375
+ expect ( overlayPane . style . maxWidth ) . toBe ( '100px' ) ;
376
+ } ) ) ;
377
+
378
+ it ( 'should should override the min-height of the overlay pane' , ( ) => {
379
+ dialog . open ( PizzaMsg , {
380
+ minHeight : '300px'
381
+ } ) ;
382
+
383
+ viewContainerFixture . detectChanges ( ) ;
384
+
385
+ let overlayPane = overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
386
+
387
+ expect ( overlayPane . style . minHeight ) . toBe ( '300px' ) ;
388
+ } ) ;
389
+
390
+ it ( 'should should override the max-height of the overlay pane' , ( ) => {
391
+ dialog . open ( PizzaMsg , {
392
+ maxHeight : '100px'
393
+ } ) ;
394
+
395
+ viewContainerFixture . detectChanges ( ) ;
396
+
397
+ let overlayPane = overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
398
+
399
+ expect ( overlayPane . style . maxHeight ) . toBe ( '100px' ) ;
400
+ } ) ;
401
+
339
402
it ( 'should should override the top offset of the overlay pane' , ( ) => {
340
403
dialog . open ( PizzaMsg , {
341
404
position : {
0 commit comments