@@ -25,10 +25,30 @@ export default function ({ getPageObjects }) {
2525 await PageObjects . maps . setAndSubmitQuery ( 'machine.os.raw : "ios"' ) ;
2626 await PageObjects . maps . waitForMapPanAndZoom ( origView ) ;
2727
28- const { lat, lon, zoom } = await PageObjects . maps . getView ( ) ;
28+ const { lat, lon } = await PageObjects . maps . getView ( ) ;
2929 expect ( Math . round ( lat ) ) . to . equal ( 43 ) ;
3030 expect ( Math . round ( lon ) ) . to . equal ( - 102 ) ;
31- expect ( Math . round ( zoom ) ) . to . equal ( 5 ) ;
31+ } ) ;
32+ } ) ;
33+
34+ describe ( 'with joins' , ( ) => {
35+ before ( async ( ) => {
36+ await PageObjects . maps . loadSavedMap ( 'join example' ) ;
37+ await PageObjects . maps . enableAutoFitToBounds ( ) ;
38+ } ) ;
39+
40+ it ( 'should automatically fit to bounds when query is applied' , async ( ) => {
41+ // Set view to other side of world so no matching results
42+ await PageObjects . maps . setView ( 0 , 0 , 6 ) ;
43+
44+ // Setting query should trigger fit to bounds and move map
45+ const origView = await PageObjects . maps . getView ( ) ;
46+ await PageObjects . maps . setAndSubmitQuery ( 'prop1 >= 11' ) ;
47+ await PageObjects . maps . waitForMapPanAndZoom ( origView ) ;
48+
49+ const { lat, lon } = await PageObjects . maps . getView ( ) ;
50+ expect ( Math . round ( lat ) ) . to . equal ( 0 ) ;
51+ expect ( Math . round ( lon ) ) . to . equal ( 60 ) ;
3252 } ) ;
3353 } ) ;
3454 } ) ;
0 commit comments