@@ -504,7 +504,7 @@ describe('igxOverlay', () => {
504
504
expect ( BaseFitPositionStrategy . prototype . position ) . toHaveBeenCalledTimes ( 3 ) ;
505
505
} ) ;
506
506
507
- it ( 'fix for #1690 - click on second filter does not close first one.' , fakeAsync ( ( ) => {
507
+ it ( '#1690 - click on second filter does not close first one.' , fakeAsync ( ( ) => {
508
508
const fixture = TestBed . createComponent ( TwoButtonsComponent ) ;
509
509
const button1 = fixture . nativeElement . getElementsByClassName ( 'buttonOne' ) [ 0 ] ;
510
510
const button2 = fixture . nativeElement . getElementsByClassName ( 'buttonTwo' ) [ 0 ] ;
@@ -521,7 +521,7 @@ describe('igxOverlay', () => {
521
521
expect ( overlayDiv . children . length ) . toBe ( 1 ) ;
522
522
} ) ) ;
523
523
524
- it ( 'fix for #1692 - scroll strategy closes overlay when shown component is scrolled.' , fakeAsync ( ( ) => {
524
+ it ( '#1692 - scroll strategy closes overlay when shown component is scrolled.' , fakeAsync ( ( ) => {
525
525
const fixture = TestBed . createComponent ( SimpleDynamicWithDirectiveComponent ) ;
526
526
const overlaySettings : OverlaySettings = { scrollStrategy : new CloseScrollStrategy ( ) } ;
527
527
fixture . componentInstance . show ( overlaySettings ) ;
@@ -548,7 +548,7 @@ describe('igxOverlay', () => {
548
548
} ) ) ;
549
549
550
550
// TODO: refactor utilities to include all exported methods in a class
551
- it ( 'fix for #1799 - content div should reposition on window resize.' , fakeAsync ( ( ) => {
551
+ it ( '#1799 - content div should reposition on window resize.' , fakeAsync ( ( ) => {
552
552
const rect : ClientRect = {
553
553
bottom : 50 ,
554
554
height : 0 ,
@@ -590,7 +590,7 @@ describe('igxOverlay', () => {
590
590
overlayInstance . hide ( id ) ;
591
591
} ) ) ;
592
592
593
- it ( 'fix for #2475 - An error is thrown for IgxOverlay when showing a component' +
593
+ it ( '#2475 - An error is thrown for IgxOverlay when showing a component' +
594
594
'instance that is not attached to the DOM' , fakeAsync ( ( ) => {
595
595
const fix = TestBed . createComponent ( SimpleRefComponent ) ;
596
596
fix . detectChanges ( ) ;
@@ -611,7 +611,7 @@ describe('igxOverlay', () => {
611
611
expect ( contentDiv . classList . contains ( CLASS_OVERLAY_CONTENT_MODAL ) ) . toBeTruthy ( ) ;
612
612
} ) ) ;
613
613
614
- it ( 'fix for #2486 - filtering dropdown is not correctly positioned' , fakeAsync ( ( ) => {
614
+ it ( '#2486 - filtering dropdown is not correctly positioned' , fakeAsync ( ( ) => {
615
615
const fix = TestBed . createComponent ( WidthTestOverlayComponent ) ;
616
616
fix . debugElement . nativeElement . style . transform = 'translatex(100px)' ;
617
617
@@ -631,7 +631,7 @@ describe('igxOverlay', () => {
631
631
expect ( fix . componentInstance . customComponent . nativeElement . getBoundingClientRect ( ) . left ) . toBe ( 400 ) ;
632
632
} ) ) ;
633
633
634
- it ( 'fix for #2798 - Allow canceling of open and close of IgxDropDown through onOpening and onClosing events' , fakeAsync ( ( ) => {
634
+ it ( '#2798 - Allow canceling of open and close of IgxDropDown through onOpening and onClosing events' , fakeAsync ( ( ) => {
635
635
const fix = TestBed . createComponent ( SimpleRefComponent ) ;
636
636
fix . detectChanges ( ) ;
637
637
const overlayInstance = fix . componentInstance . overlay ;
@@ -668,7 +668,7 @@ describe('igxOverlay', () => {
668
668
expect ( overlayInstance . onOpened . emit ) . toHaveBeenCalledTimes ( 1 ) ;
669
669
} ) ) ;
670
670
671
- it ( 'fix for #3673 - Should not close dropdown in dropdown' , fakeAsync ( ( ) => {
671
+ it ( '#3673 - Should not close dropdown in dropdown' , fakeAsync ( ( ) => {
672
672
const fix = TestBed . createComponent ( EmptyPageComponent ) ;
673
673
const button = fix . componentInstance . buttonElement ;
674
674
const overlay = fix . componentInstance . overlay ;
@@ -704,7 +704,7 @@ describe('igxOverlay', () => {
704
704
expect ( overlayDiv . children [ 0 ] . localName ) . toEqual ( 'div' ) ;
705
705
} ) ) ;
706
706
707
- it ( 'fix for #3743 - Reposition correctly resized element.' , ( ) => {
707
+ it ( '#3743 - Reposition correctly resized element.' , ( ) => {
708
708
const fixture = TestBed . createComponent ( TopLeftOffsetComponent ) ;
709
709
fixture . detectChanges ( ) ;
710
710
@@ -756,7 +756,7 @@ describe('igxOverlay', () => {
756
756
document . body . removeChild ( wrapperElement ) ;
757
757
} ) ;
758
758
759
- it ( 'Fix for #3988 - Should use ngModuleRef to create component' , inject ( [ ApplicationRef ] , ( appRef : ApplicationRef ) => {
759
+ it ( '#3988 - Should use ngModuleRef to create component' , inject ( [ ApplicationRef ] , ( appRef : ApplicationRef ) => {
760
760
const fixture = TestBed . createComponent ( EmptyPageComponent ) ;
761
761
const overlay = fixture . componentInstance . overlay ;
762
762
fixture . detectChanges ( ) ;
@@ -780,6 +780,46 @@ describe('igxOverlay', () => {
780
780
expect ( appRef . attachView ) . toHaveBeenCalledWith ( 'test' ) ;
781
781
expect ( overlay . getOverlayById ( id ) . componentRef as any ) . toBe ( mockComponent ) ;
782
782
} ) ) ;
783
+
784
+ it ( '#6474 - should calculate correctly position' , ( ) => {
785
+ const elastic : ElasticPositionStrategy = new ElasticPositionStrategy ( ) ;
786
+ const targetRect : ClientRect = {
787
+ top : 100 ,
788
+ bottom : 200 ,
789
+ height : 100 ,
790
+ left : 100 ,
791
+ right : 200 ,
792
+ width : 100
793
+ } ;
794
+ const elementRect : ClientRect = {
795
+ top : 0 ,
796
+ bottom : 300 ,
797
+ height : 300 ,
798
+ left : 0 ,
799
+ right : 300 ,
800
+ width : 300
801
+ } ;
802
+ const viewPortRect : ClientRect = {
803
+ top : 1000 ,
804
+ bottom : 1300 ,
805
+ height : 300 ,
806
+ left : 1000 ,
807
+ right : 1300 ,
808
+ width : 300
809
+ } ;
810
+ spyOn < any > ( elastic , 'setStyle' ) . and . returnValue ( { } ) ;
811
+ spyOn ( Util , 'getViewportRect' ) . and . returnValue ( viewPortRect ) ;
812
+ spyOn ( Util , 'getTargetRect' ) . and . returnValue ( targetRect ) ;
813
+
814
+ const element = jasmine . createSpyObj ( 'HTMLElement' , [ 'getBoundingClientRect' ] ) ;
815
+ spyOn ( element , 'getBoundingClientRect' ) . and . returnValue ( elementRect ) ;
816
+ element . classList = { add : ( ) => { } } ;
817
+ element . style = { width : '' , height : '' } ;
818
+ elastic . position ( element , null , null , true ) ;
819
+
820
+ expect ( element . style . width ) . toBe ( '200px' ) ;
821
+ expect ( element . style . height ) . toBe ( '100px' ) ;
822
+ } ) ;
783
823
} ) ;
784
824
785
825
describe ( 'Unit Tests - Scroll Strategies: ' , ( ) => {
@@ -2532,7 +2572,7 @@ describe('igxOverlay', () => {
2532
2572
tick ( ) ;
2533
2573
} ) ) ;
2534
2574
2535
- // Test fix for #1883 #1820
2575
+ // Test #1883 #1820
2536
2576
it ( 'It should close the component when esc key is pressed and there were other keys pressed prior to esc.' , fakeAsync ( ( ) => {
2537
2577
const fixture = TestBed . createComponent ( EmptyPageComponent ) ;
2538
2578
const overlay = fixture . componentInstance . overlay ;
0 commit comments