Skip to content

Commit a5ca365

Browse files
committed
test(mainview): cover Exit design mode (sections 5 + 6) and refactor helpers
- Add sections 5 and 6 of the control-bar TODO as user-perspective integ tests: LP stays open after exit, sidebar+CCB+toolbar fits the window with a real editor gap, toolbar lands at innerWidth/2.5 when the toggle itself opened LP, sidebar never snaps wider than its capped render across the transition, toolbar respects livePanel.minWidth + iconsBar, and clicking #toolbar-go-live in design mode exits design mode + hides LP + shrinks the toolbar to the icon-bar-only width. - Dedupe the suite's helpers: hoist WorkspaceManager, livePanel(), openLivePreview(), closeLivePreviewIfOpen(), enterDesignMode(), exitDesignMode(), resetBaseline() and the common beforeEach / afterEach to the top-level describe. Section describes now hold only the tests (plus a tiny section-5 baseline width pin). - Fix duplicate "3." section numbering — the show-in-file-tree block is now "2a." to match the TODO md. - Also include credits.md update.
1 parent 5145783 commit a5ca365

3 files changed

Lines changed: 199 additions & 145 deletions

File tree

src/thirdparty/licences/credits.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ Please find all other licenses and attributions below:
1818

1919
### https://onehtmlpagechallenge.com/
2020
* For the code samples in starter projects
21+
22+
### https://seekicon.com/author/mariusz-ostrowski
23+
* For the undo redo icons used in the editor

test/control-bar-tests-todo.md

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,6 @@ describe("mainview: central control bar + design mode", function () { … });
1010
Keep this file updated as we add coverage; remove lines as suites land.
1111

1212
---
13-
14-
## 5. Exit design mode
15-
16-
- [ ] Before flipping the body class, `sidebar.style.width` is pinned to the
17-
currently rendered (max-width-capped) value so removing the cap
18-
doesn't cause the sidebar to snap back to the stale uncapped width.
19-
- [ ] `Resizer.resyncSizer` runs after the pin so the handle follows.
20-
- [ ] Normal exit restores `#main-toolbar` to `savedToolbarWidth` (LP had
21-
been open pre-collapse) or `innerWidth / 2.5` default (LP was opened by
22-
the toggle itself). Never closes LP.
23-
- [ ] Exit clamps: sidebar + CCB + toolbar + 200 (min editor) ≤ window; if
24-
the pre-collapse toolbar width would overflow, trim the sidebar first
25-
and `data("resyncSizer")()` afterwards.
26-
- [ ] `livePanel.minWidth + iconsBar` lower bound is honored when picking
27-
the restored toolbar width.
28-
- [ ] `$sidebar.data("maxsize")` is restored to its saved percentage.
29-
- [ ] `WorkspaceManager.isInDesignMode()` returns `false`, event fires with
30-
`false`.
31-
32-
## 6. Exit triggered by hiding live preview
33-
34-
- [ ] Clicking `#toolbar-go-live` while in design mode:
35-
- LP panel hides.
36-
- `_restoreExpandedLayout` is called with `skipToolbarRestore: true`.
37-
- `#main-toolbar` ends at the icon-bar-only width (WSM's
38-
`_hidePluginSidePanel` width), not the pre-collapse LP size.
39-
- `body.ccb-editor-collapsed` is removed.
40-
4113
## 7. Sidebar drag in design mode
4214

4315
- [ ] Dragging the sidebar resizer rightward grows the sidebar linearly

0 commit comments

Comments
 (0)