@@ -165,7 +165,7 @@ describe('Overlay', () => {
165
165
166
166
overlayRef . attach ( componentPortal ) ;
167
167
168
- expect ( overlayRef . hostElement . getAttribute ( 'dir' ) ) . toEqual ( 'rtl' ) ;
168
+ expect ( overlayRef . hostElement . getAttribute ( 'dir' ) ) . toBe ( 'rtl' ) ;
169
169
} ) ;
170
170
171
171
it ( 'should emit when an overlay is attached' , ( ) => {
@@ -375,7 +375,7 @@ describe('Overlay', () => {
375
375
const overlayRef = overlay . create ( config ) ;
376
376
377
377
overlayRef . attach ( componentPortal ) ;
378
- expect ( overlayRef . overlayElement . style . width ) . toEqual ( '500px' ) ;
378
+ expect ( overlayRef . overlayElement . style . width ) . toBe ( '500px' ) ;
379
379
} ) ;
380
380
381
381
it ( 'should support using other units if a string width is provided' , ( ) => {
@@ -384,7 +384,7 @@ describe('Overlay', () => {
384
384
const overlayRef = overlay . create ( config ) ;
385
385
386
386
overlayRef . attach ( componentPortal ) ;
387
- expect ( overlayRef . overlayElement . style . width ) . toEqual ( '200%' ) ;
387
+ expect ( overlayRef . overlayElement . style . width ) . toBe ( '200%' ) ;
388
388
} ) ;
389
389
390
390
it ( 'should apply the height set in the config' , ( ) => {
@@ -393,7 +393,7 @@ describe('Overlay', () => {
393
393
const overlayRef = overlay . create ( config ) ;
394
394
395
395
overlayRef . attach ( componentPortal ) ;
396
- expect ( overlayRef . overlayElement . style . height ) . toEqual ( '500px' ) ;
396
+ expect ( overlayRef . overlayElement . style . height ) . toBe ( '500px' ) ;
397
397
} ) ;
398
398
399
399
it ( 'should support using other units if a string height is provided' , ( ) => {
@@ -402,7 +402,7 @@ describe('Overlay', () => {
402
402
const overlayRef = overlay . create ( config ) ;
403
403
404
404
overlayRef . attach ( componentPortal ) ;
405
- expect ( overlayRef . overlayElement . style . height ) . toEqual ( '100vh' ) ;
405
+ expect ( overlayRef . overlayElement . style . height ) . toBe ( '100vh' ) ;
406
406
} ) ;
407
407
408
408
it ( 'should apply the min width set in the config' , ( ) => {
@@ -411,17 +411,16 @@ describe('Overlay', () => {
411
411
const overlayRef = overlay . create ( config ) ;
412
412
413
413
overlayRef . attach ( componentPortal ) ;
414
- expect ( overlayRef . overlayElement . style . minWidth ) . toEqual ( '200px' ) ;
414
+ expect ( overlayRef . overlayElement . style . minWidth ) . toBe ( '200px' ) ;
415
415
} ) ;
416
416
417
-
418
417
it ( 'should apply the min height set in the config' , ( ) => {
419
418
config . minHeight = 500 ;
420
419
421
420
const overlayRef = overlay . create ( config ) ;
422
421
423
422
overlayRef . attach ( componentPortal ) ;
424
- expect ( overlayRef . overlayElement . style . minHeight ) . toEqual ( '500px' ) ;
423
+ expect ( overlayRef . overlayElement . style . minHeight ) . toBe ( '500px' ) ;
425
424
} ) ;
426
425
427
426
it ( 'should apply the max width set in the config' , ( ) => {
@@ -430,7 +429,7 @@ describe('Overlay', () => {
430
429
const overlayRef = overlay . create ( config ) ;
431
430
432
431
overlayRef . attach ( componentPortal ) ;
433
- expect ( overlayRef . overlayElement . style . maxWidth ) . toEqual ( '200px' ) ;
432
+ expect ( overlayRef . overlayElement . style . maxWidth ) . toBe ( '200px' ) ;
434
433
} ) ;
435
434
436
435
@@ -440,7 +439,7 @@ describe('Overlay', () => {
440
439
const overlayRef = overlay . create ( config ) ;
441
440
442
441
overlayRef . attach ( componentPortal ) ;
443
- expect ( overlayRef . overlayElement . style . maxHeight ) . toEqual ( '500px' ) ;
442
+ expect ( overlayRef . overlayElement . style . maxHeight ) . toBe ( '500px' ) ;
444
443
} ) ;
445
444
446
445
it ( 'should support zero widths and heights' , ( ) => {
@@ -450,9 +449,45 @@ describe('Overlay', () => {
450
449
const overlayRef = overlay . create ( config ) ;
451
450
452
451
overlayRef . attach ( componentPortal ) ;
453
- expect ( overlayRef . overlayElement . style . width ) . toEqual ( '0px' ) ;
454
- expect ( overlayRef . overlayElement . style . height ) . toEqual ( '0px' ) ;
452
+ expect ( overlayRef . overlayElement . style . width ) . toBe ( '0px' ) ;
453
+ expect ( overlayRef . overlayElement . style . height ) . toBe ( '0px' ) ;
455
454
} ) ;
455
+
456
+ it ( 'should be able to reset the various size properties' , ( ) => {
457
+ config . minWidth = config . minHeight = 100 ;
458
+ config . width = config . height = 200 ;
459
+ config . maxWidth = config . maxHeight = 300 ;
460
+
461
+ const overlayRef = overlay . create ( config ) ;
462
+ overlayRef . attach ( componentPortal ) ;
463
+ const style = overlayRef . overlayElement . style ;
464
+
465
+ expect ( style . minWidth ) . toBe ( '100px' ) ;
466
+ expect ( style . minHeight ) . toBe ( '100px' ) ;
467
+ expect ( style . width ) . toBe ( '200px' ) ;
468
+ expect ( style . height ) . toBe ( '200px' ) ;
469
+ expect ( style . maxWidth ) . toBe ( '300px' ) ;
470
+ expect ( style . maxHeight ) . toBe ( '300px' ) ;
471
+
472
+ overlayRef . updateSize ( {
473
+ minWidth : '' ,
474
+ minHeight : '' ,
475
+ width : '' ,
476
+ height : '' ,
477
+ maxWidth : '' ,
478
+ maxHeight : ''
479
+ } ) ;
480
+
481
+ overlayRef . updatePosition ( ) ;
482
+
483
+ expect ( style . minWidth ) . toBeFalsy ( ) ;
484
+ expect ( style . minHeight ) . toBeFalsy ( ) ;
485
+ expect ( style . width ) . toBeFalsy ( ) ;
486
+ expect ( style . height ) . toBeFalsy ( ) ;
487
+ expect ( style . maxWidth ) . toBeFalsy ( ) ;
488
+ expect ( style . maxHeight ) . toBeFalsy ( ) ;
489
+ } ) ;
490
+
456
491
} ) ;
457
492
458
493
describe ( 'backdrop' , ( ) => {
0 commit comments