2021-07-09 09:56:18 -04:00
|
|
|
// / <reference types="Cypress" />
|
|
|
|
|
2021-10-05 15:52:03 -04:00
|
|
|
describe('Will it zoom into territories correctly?', () => {
|
2021-07-09 09:56:18 -04:00
|
|
|
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
|
2021-10-05 15:52:03 -04:00
|
|
|
|
|
|
|
// Removing z as each tests has variance on it's value
|
2021-07-09 09:56:18 -04:00
|
|
|
const tests = {
|
2021-10-05 15:52:03 -04:00
|
|
|
'Lower 48': '/38.07/-95.87',
|
|
|
|
'Puerto Rico': '/18.2/-66.583',
|
2021-09-01 11:26:49 -07:00
|
|
|
|
|
|
|
// Todo: Understand what causes these two to hang intermittently ticket #579
|
2021-10-05 15:52:03 -04:00
|
|
|
// 'Alaska': '/63.28/-162.39',
|
2021-09-01 11:26:49 -07:00
|
|
|
// 'Hawaii': '5.35/20.574/-161.438',
|
2021-07-09 09:56:18 -04:00
|
|
|
};
|
|
|
|
|
2021-10-05 15:52:03 -04:00
|
|
|
for (const [territory, xy] of Object.entries(tests)) {
|
2021-07-23 08:52:34 -04:00
|
|
|
it(`Can focus on ${territory} `, () => {
|
2021-07-09 10:56:38 -04:00
|
|
|
cy.getMap().then((map) => {
|
2021-07-23 08:52:34 -04:00
|
|
|
cy.get(`[aria-label="Focus on ${territory}"]`).click();
|
2021-07-09 10:56:38 -04:00
|
|
|
cy.waitForMapIdle(map);
|
2021-10-05 15:52:03 -04:00
|
|
|
cy.log(cy.url());
|
|
|
|
cy.url().should('include', xy);
|
2021-07-09 10:56:38 -04:00
|
|
|
});
|
2021-07-09 09:56:18 -04:00
|
|
|
});
|
|
|
|
};
|
2021-07-12 08:41:29 -04:00
|
|
|
});
|