Skip to content

Commit 0aef3ff

Browse files
committed
test(mdviewer): add code block editing and checkbox integration tests
Add Code Block Editing tests: ArrowDown exit, Shift+Enter exit, Enter creates new line within block, non-last-line navigation stays in block, last-block creates new paragraph, CM→viewer content sync, and language change sync. Add checkbox-test.md and code-block-test.md fixtures. Add __clickCheckboxForTest helper in bridge.js.
1 parent 477cc57 commit 0aef3ff

3 files changed

Lines changed: 397 additions & 22 deletions

File tree

src-mdviewer/to-create-tests.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,5 @@
11
# Markdown Viewer/Editor — Integration Tests To Create
22

3-
## Slash Menu (/ command)
4-
- [x] Slash menu appears when typing / at start of line
5-
- [x] Escape dismisses slash menu
6-
- [x] Typing after / filters menu items (e.g. /image shows Image items)
7-
- [ ] Slash menu positioning (visual — needs real viewport)
8-
- [ ] Arrow down/up scrolls selected item into view
9-
- [ ] Selected item wraps around (last → first, first → last)
10-
- [ ] Slash menu works at bottom of a long scrolled document
11-
12-
## Code Block Editing
13-
- [ ] ArrowDown on last line of code block exits to paragraph below
14-
- [ ] ArrowDown on last line creates new `<p>` if none exists below
15-
- [ ] ArrowDown on last line moves to existing next sibling if present
16-
- [ ] ArrowDown on non-last line navigates normally within code block
17-
- [ ] Shift+Enter on last line of code block exits to paragraph below
18-
- [ ] Shift+Enter on non-last line does NOT exit (normal behavior)
19-
- [ ] Enter inside code block creates new line (not exit)
20-
- [ ] Code block exit syncs new paragraph to CM source
21-
- [ ] Intermediate code blocks: Shift+Enter exits on last line
22-
- [ ] Last code block in document: ArrowDown creates `<p>` and exits
23-
243
## Table Editing
254
- [ ] Clearing a table cell with backspace produces valid markdown (no broken pipe rows)
265
- [ ] Empty table cell renders as `| |` in markdown source
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Code Block Test
2+
3+
Some text before code blocks.
4+
5+
```javascript
6+
function hello() {
7+
console.log("hello");
8+
return true;
9+
}
10+
```
11+
12+
A paragraph between code blocks.
13+
14+
```python
15+
def greet():
16+
print("hello")
17+
return True
18+
```
19+
20+
Final paragraph after code blocks.

0 commit comments

Comments
 (0)