-
-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added cypress e2e test, updated translation strings
- Loading branch information
Showing
9 changed files
with
66 additions
and
3 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,44 @@ | ||
import { MaputnikDriver } from "./maputnik-driver"; | ||
|
||
describe("local file", () => { | ||
const { when, get } = new MaputnikDriver(); | ||
|
||
beforeEach(() => { | ||
when.setStyle(""); | ||
}); | ||
|
||
describe("PMTiles", () => { | ||
it("valid file loads without error", () => { | ||
const fileName = "polygon-z0.pmtiles"; // a small polygon located at Null Island | ||
|
||
const stub = cy.stub(); | ||
cy.on('window:alert', stub); | ||
|
||
get | ||
.bySelector("file", "type") | ||
.selectFile(`cypress/fixtures/${fileName}`, { force: true }); | ||
when.wait(200); | ||
cy.then(() => { | ||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions | ||
expect(stub).to.not.have.been.called; | ||
}); | ||
}); | ||
|
||
it("invalid file results in error", () => { | ||
const fileName = "example-style.json"; | ||
|
||
const stub = cy.stub(); | ||
cy.on('window:alert', stub); | ||
|
||
get | ||
.bySelector("file", "type") | ||
.selectFile(`cypress/fixtures/${fileName}`, { force: true }); | ||
when.wait(200); | ||
cy.then(() => { | ||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions | ||
expect(stub).to.be.called; | ||
expect(stub.getCall(0).args[0]).to.contain('File type is not supported'); | ||
}); | ||
}) | ||
}); | ||
}); |
Binary file not shown.
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
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
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
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
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
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
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