-
-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: shelly_goldblit <[email protected]> Co-authored-by: HarelM <[email protected]>
- Loading branch information
1 parent
124ae98
commit 8e35ed9
Showing
14 changed files
with
3,124 additions
and
1,515 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
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,60 @@ | ||
import MaputnikDriver from "./maputnik-driver"; | ||
import { MaputnikDriver } from "./maputnik-driver"; | ||
|
||
describe("keyboard", () => { | ||
let { beforeAndAfter, given, when, should } = new MaputnikDriver(); | ||
let { beforeAndAfter, given, when, get, then } = new MaputnikDriver(); | ||
beforeAndAfter(); | ||
describe("shortcuts", () => { | ||
beforeEach(() => { | ||
given.setupInterception(); | ||
given.setupMockBackedResponses(); | ||
when.setStyle(""); | ||
}); | ||
|
||
it("ESC should unfocus", () => { | ||
const targetSelector = "maputnik-select"; | ||
when.focus(targetSelector); | ||
should.beFocused(targetSelector); | ||
|
||
then(get.elementByTestId(targetSelector)).shouldBeFocused(); | ||
when.typeKeys("{esc}"); | ||
expect(should.notBeFocused(targetSelector)); | ||
then(get.elementByTestId(targetSelector)).shouldNotBeFocused(); | ||
}); | ||
|
||
it("'?' should show shortcuts modal", () => { | ||
when.typeKeys("?"); | ||
should.beVisible("modal:shortcuts"); | ||
then(get.elementByTestId("modal:shortcuts")).shouldBeVisible(); | ||
}); | ||
|
||
it("'o' should show open modal", () => { | ||
when.typeKeys("o"); | ||
should.beVisible("modal:open"); | ||
then(get.elementByTestId("modal:open")).shouldBeVisible(); | ||
}); | ||
|
||
it("'e' should show export modal", () => { | ||
when.typeKeys("e"); | ||
should.beVisible("modal:export"); | ||
then(get.elementByTestId("modal:export")).shouldBeVisible(); | ||
}); | ||
|
||
it("'d' should show sources modal", () => { | ||
when.typeKeys("d"); | ||
should.beVisible("modal:sources"); | ||
then(get.elementByTestId("modal:sources")).shouldBeVisible(); | ||
}); | ||
|
||
it("'s' should show settings modal", () => { | ||
when.typeKeys("s"); | ||
should.beVisible("modal:settings"); | ||
then(get.elementByTestId("modal:settings")).shouldBeVisible(); | ||
}); | ||
|
||
it("'i' should change map to inspect mode", () => { | ||
when.typeKeys("i"); | ||
should.beSelected("nav:inspect", "inspect"); | ||
then(get.inputValue("maputnik-select")).shouldEqual("inspect"); | ||
}); | ||
|
||
it("'m' should focus map", () => { | ||
when.typeKeys("m"); | ||
should.canvasBeFocused(); | ||
then(get.canvas()).shouldBeFocused(); | ||
}); | ||
|
||
it("'!' should show debug modal", () => { | ||
when.typeKeys("!"); | ||
should.beVisible("modal:debug"); | ||
then(get.elementByTestId("modal:debug")).shouldBeVisible(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.