@@ -1119,6 +1119,102 @@ describe('FlexibleConnectedPositionStrategy', () => {
1119
1119
expect ( Math . floor ( overlayRect . height ) ) . toBe ( OVERLAY_HEIGHT ) ;
1120
1120
} ) ;
1121
1121
1122
+ it ( 'should set the proper styles when the `bottom` value is exactly zero' , ( ) => {
1123
+ originElement . style . position = 'fixed' ;
1124
+ originElement . style . bottom = '0' ;
1125
+ originElement . style . left = '200px' ;
1126
+
1127
+ positionStrategy
1128
+ . withFlexibleWidth ( )
1129
+ . withFlexibleHeight ( )
1130
+ . withPositions ( [ {
1131
+ overlayY : 'bottom' ,
1132
+ overlayX : 'start' ,
1133
+ originY : 'bottom' ,
1134
+ originX : 'start'
1135
+ } ] ) ;
1136
+
1137
+ attachOverlay ( { positionStrategy} ) ;
1138
+
1139
+ const boundingBox = overlayContainer
1140
+ . getContainerElement ( )
1141
+ . querySelector ( '.cdk-overlay-connected-position-bounding-box' ) as HTMLElement ;
1142
+
1143
+ expect ( boundingBox . style . bottom ) . toBe ( '0px' ) ;
1144
+ } ) ;
1145
+
1146
+ it ( 'should set the proper styles when the `top` value is exactly zero' , ( ) => {
1147
+ originElement . style . position = 'fixed' ;
1148
+ originElement . style . top = '0' ;
1149
+ originElement . style . left = '200px' ;
1150
+
1151
+ positionStrategy
1152
+ . withFlexibleWidth ( )
1153
+ . withFlexibleHeight ( )
1154
+ . withPositions ( [ {
1155
+ overlayY : 'top' ,
1156
+ overlayX : 'start' ,
1157
+ originY : 'top' ,
1158
+ originX : 'start'
1159
+ } ] ) ;
1160
+
1161
+ attachOverlay ( { positionStrategy} ) ;
1162
+
1163
+ const boundingBox = overlayContainer
1164
+ . getContainerElement ( )
1165
+ . querySelector ( '.cdk-overlay-connected-position-bounding-box' ) as HTMLElement ;
1166
+
1167
+ expect ( boundingBox . style . top ) . toBe ( '0px' ) ;
1168
+ } ) ;
1169
+
1170
+ it ( 'should set the proper styles when the `left` value is exactly zero' , ( ) => {
1171
+ originElement . style . position = 'fixed' ;
1172
+ originElement . style . left = '0' ;
1173
+ originElement . style . top = '200px' ;
1174
+
1175
+ positionStrategy
1176
+ . withFlexibleWidth ( )
1177
+ . withFlexibleHeight ( )
1178
+ . withPositions ( [ {
1179
+ overlayY : 'top' ,
1180
+ overlayX : 'start' ,
1181
+ originY : 'top' ,
1182
+ originX : 'start'
1183
+ } ] ) ;
1184
+
1185
+ attachOverlay ( { positionStrategy} ) ;
1186
+
1187
+ const boundingBox = overlayContainer
1188
+ . getContainerElement ( )
1189
+ . querySelector ( '.cdk-overlay-connected-position-bounding-box' ) as HTMLElement ;
1190
+
1191
+ expect ( boundingBox . style . left ) . toBe ( '0px' ) ;
1192
+ } ) ;
1193
+
1194
+ it ( 'should set the proper styles when the `right` value is exactly zero' , ( ) => {
1195
+ originElement . style . position = 'fixed' ;
1196
+ originElement . style . right = '0' ;
1197
+ originElement . style . top = '200px' ;
1198
+
1199
+ positionStrategy
1200
+ . withFlexibleWidth ( )
1201
+ . withFlexibleHeight ( )
1202
+ . withPositions ( [ {
1203
+ overlayY : 'top' ,
1204
+ overlayX : 'end' ,
1205
+ originY : 'top' ,
1206
+ originX : 'end'
1207
+ } ] ) ;
1208
+
1209
+ attachOverlay ( { positionStrategy} ) ;
1210
+
1211
+ const boundingBox = overlayContainer
1212
+ . getContainerElement ( )
1213
+ . querySelector ( '.cdk-overlay-connected-position-bounding-box' ) as HTMLElement ;
1214
+
1215
+ expect ( boundingBox . style . right ) . toBe ( '0px' ) ;
1216
+ } ) ;
1217
+
1122
1218
} ) ;
1123
1219
1124
1220
describe ( 'onPositionChange with scrollable view properties' , ( ) => {
0 commit comments