fix some more tests

This commit is contained in:
shelly_goldblit
2023-12-31 11:40:40 +02:00
parent c694237703
commit aa8cb8f3d3
+18 -13
View File
@@ -224,18 +224,22 @@ describe("layers", () => {
}); });
}); });
it("comments", () => { describe("comments", () => {
let bgId = createBackground(); let bgId: string;
let comment = "42"; let comment = "42";
beforeEach(() => {
bgId = createBackground();
when.click("layer-list-item:background:" + bgId); when.click("layer-list-item:background:" + bgId);
when.setValue("layer-comment.input", comment); when.setValue("layer-comment.input", comment);
when.click("layer-editor.layer-id"); when.click("layer-editor.layer-id");
});
should.equalStyleStore( it("should update style in local stroage", () => {
(a: any) => a.layers, then(get.maputnikStyleFromLocalStorage()).shouldDeepNestedInclude({
[ layers: [
{ {
id: "background:" + bgId, id: "background:" + bgId,
type: "background", type: "background",
@@ -243,22 +247,23 @@ describe("layers", () => {
"maputnik:comment": comment, "maputnik:comment": comment,
}, },
}, },
] ],
); });
});
it("when unsetting should update style in local storage", () => {
// Unset it again. // Unset it again.
when.type("layer-comment.input", "{backspace}{backspace}"); when.type("layer-comment.input", "{backspace}{backspace}");
when.click("min-zoom.input-text"); when.click("min-zoom.input-text");
then(get.maputnikStyleFromLocalStorage()).shouldDeepNestedInclude({
should.equalStyleStore( layers: [
(a: any) => a.layers,
[
{ {
id: "background:" + bgId, id: "background:" + bgId,
type: "background", type: "background",
}, },
] ],
); });
});
}); });
it("color", () => { it("color", () => {