fix more tests

This commit is contained in:
shelly_goldblit
2023-12-31 18:53:46 +02:00
parent c5a7005a3d
commit 0ed6bb518f
2 changed files with 19 additions and 17 deletions
+3 -5
View File
@@ -491,12 +491,10 @@ describe("layers", () => {
type: "background", type: "background",
}); });
then(get.elementByTestId("layer-list-group:foo")).shouldBeVisible(); then(get.elementByTestId("layer-list-item:foo")).shouldBeVisible();
then(get.elementByTestId("layer-list-item:foo_bar")).shouldNotBeVisible();
then( then(
get.elementByTestId("layer-list-group:foo_bar") get.elementByTestId("layer-list-item:foo_bar_baz")
).shouldNotBeVisible();
then(
get.elementByTestId("layer-list-group:foo_bar_baz")
).shouldNotBeVisible(); ).shouldNotBeVisible();
when.click("layer-list-group:foo-0"); when.click("layer-list-group:foo-0");
then(get.elementByTestId("layer-list-item:foo")).shouldBeVisible(); then(get.elementByTestId("layer-list-item:foo")).shouldBeVisible();
+16 -12
View File
@@ -20,7 +20,7 @@ describe("modals", () => {
it.skip("upload", () => { it.skip("upload", () => {
// HM: I was not able to make the following choose file actually to select a file and close the modal... // HM: I was not able to make the following choose file actually to select a file and close the modal...
when.chooseExampleFile(); when.chooseExampleFile();
then(get.responseBody("example-style.json")).shouldDeepEqual( then(get.responseBody("example-style.json")).shouldHaveLocalStorageStyle(
get.maputnikStyleFromLocalStorageObj() get.maputnikStyleFromLocalStorageObj()
); );
}); });
@@ -34,9 +34,9 @@ describe("modals", () => {
when.wait(200); when.wait(200);
}); });
it("load from url", () => { it("load from url", () => {
then(get.responseBody("example-style.json")).shouldDeepEqual( then(
get.maputnikStyleFromLocalStorageObj() get.responseBody("example-style.json")
); ).shouldHaveLocalStorageStyle(get.maputnikStyleFromLocalStorageObj());
}); });
}); });
}); });
@@ -103,7 +103,9 @@ describe("modals", () => {
}); });
it("show name specifications", () => { it("show name specifications", () => {
then(get.maputnikStyleFromLocalStorage()).shouldDeepNestedInclude({ then(
get.maputnikStyleFromLocalStorage()
).shouldIncludeLocalStorageStyle({
name: "foobar", name: "foobar",
}); });
}); });
@@ -116,7 +118,9 @@ describe("modals", () => {
when.wait(200); when.wait(200);
}); });
it("should update owner in local storage", () => { it("should update owner in local storage", () => {
then(get.maputnikStyleFromLocalStorage()).shouldDeepNestedInclude({ then(
get.maputnikStyleFromLocalStorage()
).shouldIncludeLocalStorageStyle({
owner: "foobar", owner: "foobar",
}); });
}); });
@@ -125,7 +129,7 @@ describe("modals", () => {
it("sprite url", () => { it("sprite url", () => {
when.setValue("modal:settings.sprite", "http://example.com"); when.setValue("modal:settings.sprite", "http://example.com");
when.click("modal:settings.name"); when.click("modal:settings.name");
then(get.maputnikStyleFromLocalStorage()).shouldDeepNestedInclude({ then(get.maputnikStyleFromLocalStorage()).shouldIncludeLocalStorageStyle({
sprite: "http://example.com", sprite: "http://example.com",
}); });
}); });
@@ -133,7 +137,7 @@ describe("modals", () => {
let glyphsUrl = "http://example.com/{fontstack}/{range}.pbf"; let glyphsUrl = "http://example.com/{fontstack}/{range}.pbf";
when.setValue("modal:settings.glyphs", glyphsUrl); when.setValue("modal:settings.glyphs", glyphsUrl);
when.click("modal:settings.name"); when.click("modal:settings.name");
then(get.maputnikStyleFromLocalStorage()).shouldDeepNestedInclude({ then(get.maputnikStyleFromLocalStorage()).shouldIncludeLocalStorageStyle({
glyphs: glyphsUrl, glyphs: glyphsUrl,
}); });
}); });
@@ -145,8 +149,8 @@ describe("modals", () => {
apiKey apiKey
); );
when.click("modal:settings.name"); when.click("modal:settings.name");
then(get.maputnikStyleFromLocalStorage()).shouldDeepNestedInclude({ then(get.maputnikStyleFromLocalStorage()).shouldIncludeLocalStorageStyle({
metadata: { "maputnik:openmaptiles_access_token": apiKey }, "maputnik:openmaptiles_access_token": apiKey,
}); });
}); });
@@ -157,7 +161,7 @@ describe("modals", () => {
apiKey apiKey
); );
when.click("modal:settings.name"); when.click("modal:settings.name");
then(get.maputnikStyleFromLocalStorage()).shouldDeepNestedInclude({ then(get.maputnikStyleFromLocalStorage()).shouldIncludeLocalStorageStyle({
metadata: { "maputnik:thunderforest_access_token": apiKey }, metadata: { "maputnik:thunderforest_access_token": apiKey },
}); });
}); });
@@ -170,7 +174,7 @@ describe("modals", () => {
); );
when.click("modal:settings.name"); when.click("modal:settings.name");
then(get.maputnikStyleFromLocalStorage()).shouldDeepNestedInclude({ then(get.maputnikStyleFromLocalStorage()).shouldIncludeLocalStorageStyle({
metadata: { "maputnik:renderer": "ol" }, metadata: { "maputnik:renderer": "ol" },
}); });
}); });