mirror of
https://github.com/maputnik/editor.git
synced 2026-09-28 15:13:45 +00:00
- Replaces #1870, which replaced #1682, #1677 This mostly uses the code from there and addresses the comments I've left. I didn't change the code much. ## Launch Checklist Makes the sidebar panel resizable <img width="707" height="511" alt="image" src="https://github.com/user-attachments/assets/d010df38-faac-441c-bf7f-a4960e471c61" /> - [x] Briefly describe the changes in this PR. - [x] Link to related issues. - [x] Include before/after visuals or gifs if this PR includes visual changes. - [x] Write tests for all new functionality. - [x] Add an entry to `CHANGELOG.md` under the `## main` section. --------- Co-authored-by: Bart Louwers <bart.louwers@gmail.com>
28 lines
918 B
TypeScript
28 lines
918 B
TypeScript
import { beforeEach, describe, test } from "./utils/fixtures";
|
|
import { MaputnikDriver } from "./maputnik-driver";
|
|
|
|
describe("sidebar resize", () => {
|
|
const { given, get, when, then } = new MaputnikDriver();
|
|
|
|
beforeEach(async () => {
|
|
await given.setupMockBackedResponses();
|
|
await when.setStyle("layer");
|
|
});
|
|
|
|
test("dragging the outer handle widens the sidebar", async () => {
|
|
const initialWidth = await get.elementWidth("sidebar-panel").get();
|
|
|
|
await when.dragBy("sidebar-resize-handle", 100);
|
|
|
|
await then(get.elementWidth("sidebar-panel")).shouldBeGreaterThan(initialWidth + 50);
|
|
});
|
|
|
|
test("dragging the inner handle widens the layer list", async () => {
|
|
const initialWidth = await get.elementWidth("layer-list-panel").get();
|
|
|
|
await when.dragBy("inner-resize-handle", 50);
|
|
|
|
await then(get.elementWidth("layer-list-panel")).shouldBeGreaterThan(initialWidth + 20);
|
|
});
|
|
});
|