mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-07-31 11:11:17 -07:00
Clicking territory focus button sometimes focuses on a different CBG, not the actual territory (#412)
* Fixing #410 - Clicking a CBG region, then another, then hitting territory button results in random CBG being selected * Part of fix for #410 - refactoring selection logic to remove setFeatureState call. * Renaming layers for clarity and adding constants * Using constant for layer identifier * Fixes #409 - Loading a URL with lat/lng/zoom specified occasionally does not work . We now parse the URL on page before initializing the map. Also adds tests for this
This commit is contained in:
parent
36f43b2d44
commit
a2ba9236ab
6 changed files with 78 additions and 87 deletions
|
@ -15,5 +15,19 @@ describe('LatLng Test', () => {
|
|||
cy.url().should('include', '#4/35.04/-77.9');
|
||||
});
|
||||
});
|
||||
it('allows user to specify alternative starting URL', () => {
|
||||
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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue