mirror of
https://github.com/maputnik/editor.git
synced 2026-01-03 20:10:02 +00:00
Use node 16.x
It required converting mocha tests code into async since [@wdio/sync is deprecated](https://webdriver.io/docs/sync-vs-async/) starting with node v16. It removed the dependency on fibers and on [node-gyp + python](https:// webdriver.io/docs/sync-vs-async/#common-issues-in-sync-mode) indirectly though which is a great thing. Also moved away from node-sass to sass since [node-sass is deprecated] (https://sass-lang.com/blog/libsass-is-deprecated).
This commit is contained in:
@@ -1,57 +1,55 @@
|
||||
var assert = require("assert");
|
||||
var config = require("../../config/specs");
|
||||
var helper = require("../helper");
|
||||
var wd = require("../../wd-helper");
|
||||
|
||||
|
||||
describe("keyboard", function() {
|
||||
describe("shortcuts", function() {
|
||||
it("ESC should unfocus", function() {
|
||||
const tmpTargetEl = $(wd.$("nav:inspect") + " select");
|
||||
tmpTargetEl.click();
|
||||
assert(tmpTargetEl.isFocused());
|
||||
it("ESC should unfocus", async function() {
|
||||
const tmpTargetEl = await $(wd.$("nav:inspect") + " select");
|
||||
await tmpTargetEl.click();
|
||||
assert(await tmpTargetEl.isFocused());
|
||||
|
||||
browser.keys(["Escape"]);
|
||||
assert($("body").isFocused());
|
||||
await browser.keys(["Escape"]);
|
||||
assert(await (await $("body")).isFocused());
|
||||
});
|
||||
|
||||
it("'?' should show shortcuts modal", function() {
|
||||
browser.keys(["?"]);
|
||||
assert($(wd.$("modal:shortcuts")).isDisplayed());
|
||||
it("'?' should show shortcuts modal", async function() {
|
||||
await browser.keys(["?"]);
|
||||
assert(await (await $(wd.$("modal:shortcuts"))).isDisplayed());
|
||||
});
|
||||
|
||||
it("'o' should show open modal", function() {
|
||||
browser.keys(["o"]);
|
||||
assert($(wd.$("modal:open")).isDisplayed());
|
||||
it("'o' should show open modal", async function() {
|
||||
await browser.keys(["o"]);
|
||||
assert(await (await $(wd.$("modal:open"))).isDisplayed());
|
||||
});
|
||||
|
||||
it("'e' should show export modal", function() {
|
||||
browser.keys(["e"]);
|
||||
assert($(wd.$("modal:export")).isDisplayed());
|
||||
it("'e' should show export modal", async function() {
|
||||
await browser.keys(["e"]);
|
||||
assert(await (await $(wd.$("modal:export"))).isDisplayed());
|
||||
});
|
||||
|
||||
it("'d' should show sources modal", function() {
|
||||
browser.keys(["d"]);
|
||||
assert($(wd.$("modal:sources")).isDisplayed());
|
||||
it("'d' should show sources modal", async function() {
|
||||
await browser.keys(["d"]);
|
||||
assert(await (await $(wd.$("modal:sources"))).isDisplayed());
|
||||
});
|
||||
|
||||
it("'s' should show settings modal", function() {
|
||||
browser.keys(["s"]);
|
||||
assert($(wd.$("modal:settings")).isDisplayed());
|
||||
it("'s' should show settings modal", async function() {
|
||||
await browser.keys(["s"]);
|
||||
assert(await (await $(wd.$("modal:settings"))).isDisplayed());
|
||||
});
|
||||
|
||||
it.skip("'i' should change map to inspect mode", function() {
|
||||
// browser.keys(["i"]);
|
||||
it.skip("'i' should change map to inspect mode", async function() {
|
||||
// await browser.keys(["i"]);
|
||||
});
|
||||
|
||||
it("'m' should focus map", function() {
|
||||
browser.keys(["m"]);
|
||||
$(".mapboxgl-canvas").isFocused();
|
||||
it("'m' should focus map", async function() {
|
||||
await browser.keys(["m"]);
|
||||
assert(await (await $(".mapboxgl-canvas")).isFocused());
|
||||
});
|
||||
|
||||
it("'!' should show debug modal", function() {
|
||||
browser.keys(["!"]);
|
||||
assert($(wd.$("modal:debug")).isDisplayed());
|
||||
it("'!' should show debug modal", async function() {
|
||||
await browser.keys(["!"]);
|
||||
assert(await (await $(wd.$("modal:debug"))).isDisplayed());
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user