fix some more tests

This commit is contained in:
shelly_goldblit
2023-12-31 11:31:31 +02:00
parent ba201935a8
commit c694237703
+52 -44
View File
@@ -162,58 +162,66 @@ describe("layers", () => {
); );
}); });
it("min-zoom", () => { describe("min-zoom", () => {
let bgId = createBackground(); let bgId: string;
when.click("layer-list-item:background:" + bgId); beforeEach(() => {
when.setValue("min-zoom.input-text", "1"); bgId = createBackground();
when.click("layer-list-item:background:" + bgId);
when.setValue("min-zoom.input-text", "1");
when.click("layer-editor.layer-id");
});
when.click("layer-editor.layer-id"); it("should update min-zoom in local storage", () => {
then(get.maputnikStyleFromLocalStorage()).shouldDeepNestedInclude({
layers: [
{
id: "background:" + bgId,
type: "background",
minzoom: 1,
},
],
});
});
should.equalStyleStore( it("when clicking next layer should update style on local storage", () => {
(a: any) => a.layers, when.type("min-zoom.input-text", "{backspace}");
[ when.click("max-zoom.input-text");
{ then(get.maputnikStyleFromLocalStorage()).shouldDeepNestedInclude({
id: "background:" + bgId, layers: [
type: "background", {
minzoom: 1, id: "background:" + bgId,
}, type: "background",
] minzoom: 1,
); },
],
// AND RESET! });
when.type("min-zoom.input-text", "{backspace}"); });
when.click("max-zoom.input-text");
should.equalStyleStore(
(a: any) => a.layers,
[
{
id: "background:" + bgId,
type: "background",
},
]
);
}); });
it("max-zoom", () => { describe("max-zoom", () => {
let bgId = createBackground(); let bgId: string;
when.click("layer-list-item:background:" + bgId); beforeEach(() => {
when.setValue("max-zoom.input-text", "1"); bgId = createBackground();
when.click("layer-editor.layer-id"); when.click("layer-list-item:background:" + bgId);
when.setValue("max-zoom.input-text", "1");
should.equalStyleStore( when.click("layer-editor.layer-id");
(a: any) => a.layers, });
[
{ it("should update style in local storage", () => {
id: "background:" + bgId, then(get.maputnikStyleFromLocalStorage()).shouldDeepNestedInclude({
type: "background", layers: [
maxzoom: 1, {
}, id: "background:" + bgId,
] type: "background",
); maxzoom: 1,
},
],
});
});
}); });
it("comments", () => { it("comments", () => {