mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-02-23 10:04:18 -08:00
* Display SurveyMonkey survey via FAB - add Floating Action Button lib: react-tiny-fab - enable Internal Page Survey with ?flags=ips - update snapshots * Add location to state - update snapshots * Fix build error - remove react-tiny-fab - remove location state - create custom FAB component - remove feature flag - update snapshots * Add SurveyFab snapshot test * Remove embedded survey page - add intl * Remove conditional render logic on SurveyFab * Remove cypress test around starting map via URL - increase component code coverage to 83%
48 lines
1.7 KiB
JavaScript
48 lines
1.7 KiB
JavaScript
// / <reference types="Cypress" />
|
|
|
|
describe('Does the map zoom and adjust to lat/long correctly?', () => {
|
|
it('should start at zoom level 3', () => {
|
|
cy.visit('http://localhost:8000/en/cejst');
|
|
cy.url().should('include', '#3');
|
|
});
|
|
it('should change to level 4 when you hit the zoom button', () => {
|
|
cy.get('.mapboxgl-ctrl-icon.mapboxgl-ctrl-zoom-in').click();
|
|
cy.url().should('include', '#4');
|
|
});
|
|
it('should show the correct lat/lng coordinates in the URL', () => {
|
|
cy.getMap().then((map) => {
|
|
cy.panTo(map, [-77.9, 35.04]);
|
|
cy.url().should('include', '#4/35.04/-77.9');
|
|
});
|
|
});
|
|
|
|
// This test hangs intermittently (30% of the time) need to investigate why
|
|
// it('allows user to specify alternative starting URL',
|
|
// {
|
|
// retries: {
|
|
// runMode: 3,
|
|
// openMode: 3,
|
|
// },
|
|
// defaultCommandTimeout: 4000,
|
|
// execTimeout: 10000,
|
|
// taskTimeout: 10000,
|
|
// pageLoadTimeout: 10000,
|
|
// requestTimeout: 5000,
|
|
// responseTimeout: 10000,
|
|
// },
|
|
// () => {
|
|
// const [expectedZoom, expectedLat, expectedLng] = [12.05, 41.40965, -75.65978];
|
|
// const expectedURL = `http://localhost:8000/en/cejst/#${expectedZoom}/${expectedLat}/${expectedLng}`;
|
|
// cy.visit(expectedURL);
|
|
// cy.getMap().then((map) => {
|
|
// cy.waitForMapIdle(map);
|
|
// cy.url().should('equal', expectedURL);
|
|
// const actualZoom = map.getZoom();
|
|
// const actualCenter = map.getCenter();
|
|
// expect(actualCenter.lat).to.eq(expectedLat);
|
|
// expect(actualCenter.lng).to.eq(expectedLng);
|
|
// expect(actualZoom).to.eq(expectedZoom);
|
|
// });
|
|
// });
|
|
});
|
|
|