-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for osm landfill layer and unearthing layer
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
describe('OSM Landfill, Mines and Quarries layer', function() { | ||
it('adds markers on click', function() { | ||
cy.openWindow('/example/index.html#lat=42.7029&lon=-99.1509&zoom=11&layers=Standard') | ||
cy.wait(300) | ||
cy.window().then((win) => { | ||
const stub = cy.stub(win.OSMLandfillMineQuarryLayer, 'requestData') | ||
cy.get('#menu-osmLandfillMineQuarryLayer label').click({ force: true }).then(() => { | ||
expect(stub).to.be.called | ||
}) | ||
}) | ||
}) | ||
|
||
it('should have the layer name added to the hash', function() { | ||
cy.hash().should('eq', '#lat=42.7029&lon=-99.1509&zoom=11&layers=Standard,osmLandfillMineQuarryLayer') | ||
}) | ||
|
||
it('removes layer name from the hash when clicked again', function() { | ||
cy.get('#menu-osmLandfillMineQuarryLayer label').click({ force: true }) | ||
cy.hash().should('eq', '#lat=42.7029&lon=-99.1509&zoom=11&layers=Standard') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
describe('Unearthing layer', function() { | ||
it('adds markers on click', function() { | ||
cy.openWindow('/example/index.html#lat=51.15&lon=13.45&zoom=4&layers=Standard') | ||
cy.wait(300) | ||
cy.window().then((win) => { | ||
const stub = cy.stub(win.Unearthing, 'requestData') | ||
cy.get('#menu-Unearthing label').click({ force: true }).then(() => { | ||
expect(stub).to.be.called | ||
}) | ||
}) | ||
}) | ||
|
||
it('should have the layer name added to the hash', function() { | ||
cy.hash().should('eq', '#lat=51.15&lon=13.45&zoom=4&layers=Standard,Unearthing') | ||
}) | ||
|
||
it('removes layer name from the hash when clicked again', function() { | ||
cy.get('#menu-Unearthing label').click({ force: true }) | ||
cy.hash().should('eq', '#lat=51.15&lon=13.45&zoom=4&layers=Standard') | ||
}) | ||
}) |