j40-cejst-2/client/cypress/integration/LegacyTests/mapZoomTerritories.spec.js
Vim 68014c94e4
Fix AREA MEDIAN INCOME prop on map (#860)
- add indicator values of selected CBG to console
- update snapshots
- update cypress tests (failure on zoom)
2021-11-05 08:43:47 -07:00

32 lines
965 B
JavaScript

// / <reference types="Cypress" />
describe('Will it zoom into territories correctly?', () => {
beforeEach(() => {
cy.viewport('macbook-13');
cy.visit('http://localhost:8000/en/cejst');
});
// The below values all assume a 13-inch MB as set in viewport above.
// Values will be different for different screens
// Removing z as each tests has variance on it's value
const tests = {
'Lower 48': '/38.07/-95.87',
// Todo: Understand what causes these two to hang intermittently ticket #579
// 'Puerto Rico': '/18.2/-66.583',
// 'Alaska': '/63.28/-162.39',
// 'Hawaii': '5.35/20.574/-161.438',
};
for (const [territory, xy] of Object.entries(tests)) {
it(`Can focus on ${territory} `, () => {
cy.getMap().then((map) => {
cy.get(`[aria-label="Focus on ${territory}"]`).click();
cy.waitForMapIdle(map);
cy.log(cy.url());
cy.url().should('include', xy);
});
});
};
});