diff --git a/test/browserTests/street-geo-test-bdd.mjs b/test/browserTests/street-geo-test-bdd.mjs index 0003b3c38..2f6b6eff7 100644 --- a/test/browserTests/street-geo-test-bdd.mjs +++ b/test/browserTests/street-geo-test-bdd.mjs @@ -33,26 +33,30 @@ describe('street-geo component', function() { el.setAttribute('street-geo', 'maps', 'google3d'); setTimeout(() => { - const updatedMapbox2dElement = el.querySelector('[data-layer-name="Mapbox Satellite Streets"]'); - const updatedGoogle3dElement = el.querySelector('[data-layer-name="Google 3D Tiles"]'); - - expect(updatedMapbox2dElement).to.not.exist; - expect(updatedGoogle3dElement).to.exist; - - done(); - }, 1000); + setTimeout(() => { + const updatedMapbox2dElement = el.querySelector('[data-layer-name="Mapbox Satellite Streets"]'); + const updatedGoogle3dElement = el.querySelector('[data-layer-name="Google 3D Tiles"]'); + + expect(updatedMapbox2dElement).to.not.exist; + expect(updatedGoogle3dElement).to.exist; + + done(); + }); + }); }); it('should create both mapbox2d and google3d elements', (done) => { el.setAttribute('street-geo', 'maps', 'mapbox2d, google3d'); setTimeout(() => { - const mapbox2dElement = el.querySelector('[data-layer-name="Mapbox Satellite Streets"]'); - const google3dElement = el.querySelector('[data-layer-name="Google 3D Tiles"]'); - expect(mapbox2dElement).to.exist; - expect(google3dElement).to.exist; - done(); - }, 1000); + setTimeout(() => { + const mapbox2dElement = el.querySelector('[data-layer-name="Mapbox Satellite Streets"]'); + const google3dElement = el.querySelector('[data-layer-name="Google 3D Tiles"]'); + expect(mapbox2dElement).to.exist; + expect(google3dElement).to.exist; + done(); + }); + }); }); it('should delete mapbox2d and google3d elements after setting maps attribute to empty', (done) => { @@ -65,14 +69,16 @@ describe('street-geo component', function() { el.setAttribute('street-geo', 'maps', ''); setTimeout(() => { - const updatedMapbox2dElement = el.querySelector('[data-layer-name="Mapbox Satellite Streets"]'); - const updatedGoogle3dElement = el.querySelector('[data-layer-name="Google 3D Tiles"]'); - - expect(updatedMapbox2dElement).to.not.exist; - expect(updatedGoogle3dElement).to.not.exist; - - done(); - }, 1000); + setTimeout(() => { + const updatedMapbox2dElement = el.querySelector('[data-layer-name="Mapbox Satellite Streets"]'); + const updatedGoogle3dElement = el.querySelector('[data-layer-name="Google 3D Tiles"]'); + + expect(updatedMapbox2dElement).to.not.exist; + expect(updatedGoogle3dElement).to.not.exist; + + done(); + }); + }); }); it('should update latitude, longitude, and elevation for google3d', (done) => { @@ -82,15 +88,17 @@ describe('street-geo component', function() { el.setAttribute('street-geo', 'elevation', 100); setTimeout(() => { - const google3dElement = el.querySelector('[data-layer-name="Google 3D Tiles"]'); - expect(google3dElement).to.exist; - - const loader3dtilesAttr = google3dElement.getAttribute('loader-3dtiles'); - expect(loader3dtilesAttr.long).to.equal(40); - expect(loader3dtilesAttr.lat).to.equal(50); - expect(loader3dtilesAttr.height).to.equal(100 - 32.49158); - - done(); - }, 1000); + setTimeout(() => { + const google3dElement = el.querySelector('[data-layer-name="Google 3D Tiles"]'); + expect(google3dElement).to.exist; + + const loader3dtilesAttr = google3dElement.getAttribute('loader-3dtiles'); + expect(loader3dtilesAttr.long).to.equal(40); + expect(loader3dtilesAttr.lat).to.equal(50); + expect(loader3dtilesAttr.height).to.equal(100 - 32.49158); + + done(); + }); + }); }); });