Skip to content

Commit 7345b97

Browse files
committed
test(mdviewer): add list editing integration tests
Add 9 list editing tests: Enter splits li, Enter on empty li exits list, Shift+Enter inserts br, Tab indents, Shift+Tab outdents, Shift+Tab preserves trailing siblings, Tab on first item does nothing, cursor preserved after indent, and Enter syncs new bullet to CM. Add list-test.md fixture file.
1 parent 0aef3ff commit 7345b97

3 files changed

Lines changed: 375 additions & 28 deletions

File tree

src-mdviewer/to-create-tests.md

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@
3636
- [ ] Add-column button visible when table is active (cursor inside)
3737

3838
## List Editing
39-
- [ ] Enter in a list item splits content at cursor into two `<li>` elements
40-
- [ ] Enter on empty list item exits list and creates paragraph below
41-
- [ ] Shift+Enter in list item inserts `<br>` (line break within same bullet)
42-
- [ ] Tab in list item indents it (nests inside sub-list under previous sibling)
43-
- [ ] Shift+Tab in list item outdents it to parent level
44-
- [ ] Shift+Tab outdent preserves trailing siblings as sub-list of moved item
45-
- [ ] Tab at first list item (no previous sibling) does nothing
46-
- [ ] Cursor position preserved after Tab indent
39+
- [x] Enter in a list item splits content at cursor into two `<li>` elements
40+
- [x] Enter on empty list item exits list and creates paragraph below
41+
- [x] Shift+Enter in list item inserts `<br>` (line break within same bullet)
42+
- [x] Tab in list item indents it (nests inside sub-list under previous sibling)
43+
- [x] Shift+Tab in list item outdents it to parent level
44+
- [x] Shift+Tab outdent preserves trailing siblings as sub-list of moved item
45+
- [x] Tab at first list item (no previous sibling) does nothing
46+
- [x] Cursor position preserved after Tab indent
4747
- [ ] Cursor position preserved after Shift+Tab outdent
48-
- [ ] Enter in list creates proper `<li>` that syncs to markdown `- ` or `1. ` in CM
48+
- [x] Enter in list creates proper `<li>` that syncs to markdown `- ` or `1. ` in CM
4949
- [ ] Nested list indentation syncs correctly to markdown (2 or 4 space indent)
5050

5151
## UL/OL Toggle (List Type Switching)
@@ -91,25 +91,6 @@
9191
- [ ] Typing in CM and undoing in CM doesn't interfere with md editor
9292
- [ ] Multiple rapid edits can be undone one by one
9393

94-
## Scroll Behavior
95-
- [ ] Cursor sync scroll is instant (not smooth animated)
96-
- [ ] Scroll restore on file switch uses exact pixel position (no jump)
97-
- [ ] Scroll restore on reload uses source-line-based positioning
98-
- [ ] No progressive scroll-down on reload with many images (source-line approach)
99-
100-
## Border & Styling
101-
- [ ] Subtle bottom border on #mainNavBar (rgba(255,255,255,0.08))
102-
- [ ] Subtle bottom border on #live-preview-plugin-toolbar (rgba(255,255,255,0.08))
103-
- [ ] No medium-zoom magnifying glass cursor on images
104-
- [ ] Cursor sync icon is subtle (secondary text color, not accent blue)
105-
106-
## Translation (i18n)
107-
- [ ] en.json strings load correctly (toolbar.reader, format.underline, etc.)
108-
- [ ] Locale with region code (e.g. en-GB) falls back to base (en) if specific file missing
109-
- [ ] No "Failed to load locale" console warnings for valid locales
110-
- [ ] gulp translateStrings translates both Phoenix NLS and mdviewer locales
111-
- [ ] Translated locale files copied back to src-mdviewer/src/locales/
112-
11394
## In-Document Search (Ctrl+F)
11495
- [ ] Ctrl+F opens search bar in md viewer (both edit and reader mode)
11596
- [ ] Ctrl+F with text selected pre-fills search and highlights closest match as active
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# List Test
2+
3+
## Unordered List
4+
5+
- First item
6+
- Second item with some text
7+
- Third item
8+
- Fourth item
9+
10+
## Nested List
11+
12+
- Parent one
13+
- Child one
14+
- Child two
15+
- Child three
16+
- Parent two
17+
18+
## Ordered List
19+
20+
1. First ordered
21+
2. Second ordered
22+
3. Third ordered
23+
24+
End of list test.

0 commit comments

Comments
 (0)