@@ -57,7 +57,7 @@ describe('FlexibleConnectedPositionStrategy', () => {
57
57
}
58
58
59
59
it ( 'should throw when attempting to attach to multiple different overlays' , ( ) => {
60
- const origin = new ElementRef ( document . createElement ( 'div' ) ) ;
60
+ const origin = document . createElement ( 'div' ) ;
61
61
const positionStrategy = overlay . position ( )
62
62
. flexibleConnectedTo ( origin )
63
63
. withPositions ( [ {
@@ -68,16 +68,16 @@ describe('FlexibleConnectedPositionStrategy', () => {
68
68
} ] ) ;
69
69
70
70
// Needs to be in the DOM for IE not to throw an "Unspecified error".
71
- document . body . appendChild ( origin . nativeElement ) ;
71
+ document . body . appendChild ( origin ) ;
72
72
attachOverlay ( { positionStrategy} ) ;
73
73
74
74
expect ( ( ) => attachOverlay ( { positionStrategy} ) ) . toThrow ( ) ;
75
75
76
- document . body . removeChild ( origin . nativeElement ) ;
76
+ document . body . removeChild ( origin ) ;
77
77
} ) ;
78
78
79
79
it ( 'should not throw when trying to apply after being disposed' , ( ) => {
80
- const origin = new ElementRef ( document . createElement ( 'div' ) ) ;
80
+ const origin = document . createElement ( 'div' ) ;
81
81
const positionStrategy = overlay . position ( )
82
82
. flexibleConnectedTo ( origin )
83
83
. withPositions ( [ {
@@ -88,17 +88,17 @@ describe('FlexibleConnectedPositionStrategy', () => {
88
88
} ] ) ;
89
89
90
90
// Needs to be in the DOM for IE not to throw an "Unspecified error".
91
- document . body . appendChild ( origin . nativeElement ) ;
91
+ document . body . appendChild ( origin ) ;
92
92
attachOverlay ( { positionStrategy} ) ;
93
93
overlayRef . dispose ( ) ;
94
94
95
95
expect ( ( ) => positionStrategy . apply ( ) ) . not . toThrow ( ) ;
96
96
97
- document . body . removeChild ( origin . nativeElement ) ;
97
+ document . body . removeChild ( origin ) ;
98
98
} ) ;
99
99
100
100
it ( 'should not throw when trying to re-apply the last position after being disposed' , ( ) => {
101
- const origin = new ElementRef ( document . createElement ( 'div' ) ) ;
101
+ const origin = document . createElement ( 'div' ) ;
102
102
const positionStrategy = overlay . position ( )
103
103
. flexibleConnectedTo ( origin )
104
104
. withPositions ( [ {
@@ -109,13 +109,13 @@ describe('FlexibleConnectedPositionStrategy', () => {
109
109
} ] ) ;
110
110
111
111
// Needs to be in the DOM for IE not to throw an "Unspecified error".
112
- document . body . appendChild ( origin . nativeElement ) ;
112
+ document . body . appendChild ( origin ) ;
113
113
attachOverlay ( { positionStrategy} ) ;
114
114
overlayRef . dispose ( ) ;
115
115
116
116
expect ( ( ) => positionStrategy . reapplyLastPosition ( ) ) . not . toThrow ( ) ;
117
117
118
- document . body . removeChild ( origin . nativeElement ) ;
118
+ document . body . removeChild ( origin ) ;
119
119
} ) ;
120
120
121
121
describe ( 'without flexible dimensions and pushing' , ( ) => {
@@ -132,7 +132,7 @@ describe('FlexibleConnectedPositionStrategy', () => {
132
132
originElement = createPositionedBlockElement ( ) ;
133
133
document . body . appendChild ( originElement ) ;
134
134
positionStrategy = overlay . position ( )
135
- . flexibleConnectedTo ( new ElementRef ( originElement ) )
135
+ . flexibleConnectedTo ( originElement )
136
136
. withFlexibleDimensions ( false )
137
137
. withPush ( false ) ;
138
138
} ) ;
@@ -984,7 +984,7 @@ describe('FlexibleConnectedPositionStrategy', () => {
984
984
originElement = createPositionedBlockElement ( ) ;
985
985
document . body . appendChild ( originElement ) ;
986
986
positionStrategy = overlay . position ( )
987
- . flexibleConnectedTo ( new ElementRef ( originElement ) )
987
+ . flexibleConnectedTo ( originElement )
988
988
. withFlexibleDimensions ( false )
989
989
. withPush ( ) ;
990
990
} ) ;
@@ -1113,7 +1113,7 @@ describe('FlexibleConnectedPositionStrategy', () => {
1113
1113
beforeEach ( ( ) => {
1114
1114
originElement = createPositionedBlockElement ( ) ;
1115
1115
document . body . appendChild ( originElement ) ;
1116
- positionStrategy = overlay . position ( ) . flexibleConnectedTo ( new ElementRef ( originElement ) ) ;
1116
+ positionStrategy = overlay . position ( ) . flexibleConnectedTo ( originElement ) ;
1117
1117
} ) ;
1118
1118
1119
1119
afterEach ( ( ) => {
@@ -1532,7 +1532,7 @@ describe('FlexibleConnectedPositionStrategy', () => {
1532
1532
1533
1533
// Create a strategy with knowledge of the scrollable container
1534
1534
const strategy = overlay . position ( )
1535
- . flexibleConnectedTo ( new ElementRef ( originElement ) )
1535
+ . flexibleConnectedTo ( originElement )
1536
1536
. withPush ( false )
1537
1537
. withPositions ( [ {
1538
1538
originX : 'start' ,
@@ -1611,7 +1611,7 @@ describe('FlexibleConnectedPositionStrategy', () => {
1611
1611
beforeEach ( ( ) => {
1612
1612
originElement = createPositionedBlockElement ( ) ;
1613
1613
document . body . appendChild ( originElement ) ;
1614
- positionStrategy = overlay . position ( ) . flexibleConnectedTo ( new ElementRef ( originElement ) ) ;
1614
+ positionStrategy = overlay . position ( ) . flexibleConnectedTo ( originElement ) ;
1615
1615
} ) ;
1616
1616
1617
1617
afterEach ( ( ) => {
@@ -1721,7 +1721,7 @@ describe('FlexibleConnectedPositionStrategy', () => {
1721
1721
beforeEach ( ( ) => {
1722
1722
originElement = createPositionedBlockElement ( ) ;
1723
1723
document . body . appendChild ( originElement ) ;
1724
- positionStrategy = overlay . position ( ) . flexibleConnectedTo ( new ElementRef ( originElement ) ) ;
1724
+ positionStrategy = overlay . position ( ) . flexibleConnectedTo ( originElement ) ;
1725
1725
} ) ;
1726
1726
1727
1727
afterEach ( ( ) => {
0 commit comments