Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update aqicn.spec.js to address layer-specific test failures #670

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jywarren
Copy link
Member

@jywarren jywarren commented Jun 7, 2022

Attempting some fixes to aqicn spec from #668 - reordering first, then will try ensuring we use fixture data instead of a real request on:

it('has circle markers in minimal mode', function() {
cy.server()
cy.route('GET', 'https://api.waqi.info/map/bounds/?latlng=31.052933985705163,-30.498046875000004,65.18303007291382,57.39257812500001&token=566331c289f0aeacd78e0b18362b4bcfa5097572', 'fixture:aqicn.json')
const spy = cy.spy(window.top.aut.AQICNLayer, 'requestRegionData')
cy.get('[title="Show minimal markers"]').click().then(() => {
expect(spy).to.be.called
cy.get('.leaflet-overlay-pane svg g').children().should('have.length', 2)
cy.get('.leaflet-overlay-pane svg g path').invoke('attr', 'stroke').should('eq', '#7c7c7c')
cy.get('.leaflet-overlay-pane svg g path').invoke('attr', 'stroke-linecap').should('eq', 'round')
cy.get('.leaflet-overlay-pane svg g path').invoke('attr', 'stroke-linecap').should('eq', 'round')
})
})
it('shows popup', function() {
cy.get('.leaflet-overlay-pane svg g').children().last().click({ force: true })
cy.get('.leaflet-popup-pane').children().should('have.length', 1)
cy.get('.leaflet-popup-content').should('contain', 'Spain')
})

@gitpod-io
Copy link

gitpod-io bot commented Jun 7, 2022

@@ -25,7 +25,7 @@ describe('Aqicn layer', function() {

it('has circle markers in minimal mode', function() {
cy.server()
cy.route('GET', 'https://api.waqi.info/map/bounds/?latlng=31.052933985705163,-30.498046875000004,65.18303007291382,57.39257812500001&token=566331c289f0aeacd78e0b18362b4bcfa5097572', 'fixture:aqicn.json')
cy.route('GET', 'https://api.waqi.info/map/bounds/**', 'fixture:aqicn.json')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jywarren
Copy link
Member Author

jywarren commented Jun 7, 2022

I see that for some reason it's zoomed into zoom 3, and some kind of random location.

-'#lat=42.94&lon=-82.97&zoom=3&layers=Standard,aqicnLayer'
+'#lat=51.15&lon=13.45&zoom=4&layers=Standard,aqicnLayer'

It doesn't look like clicking a marker and getting a popup, it doesn't pan the screen. Zoom 3 is pretty zoomed out, and -82 corrects to -52 because we can't look off the edge of the world. But otherwise looks innocuous. Not sure where 42x-82 coordinates are coming from? That's near Flint, Michigan, while the original was in Germany.

Aha - ok, the default map location is set in /example/layers.js - .setView([43, -83], 3);

@jywarren jywarren changed the title Update aqicn.spec.js Update aqicn.spec.js to address layer-specific test failures Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant