Skip to content

Commit 15f5888

Browse files
committed
Add manual preview tests for single-file root URL accessibility
T17: Verify GET / returns 200 for single-file preview T18: Verify GET /filename.html also works T19: Verify project preview paths still work with isSingleFile guard
1 parent 3e4308b commit 15f5888

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

tests/docs/manual/preview/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,35 @@ For tests without Jupyter execution (T9, T10, T11), verify no `.quarto_ipynb` fi
132132
- **Steps:** Preview project, edit index, navigate to about, edit about
133133
- **Expected:** At most one `.quarto_ipynb` per Jupyter-using file. No accumulation.
134134

135+
## Test Matrix: Single-file Preview Root URL (#14298)
136+
137+
After every change to preview URL or handler logic, verify that single-file previews serve content at the root URL and print the correct Browse URL.
138+
139+
### P1: Critical
140+
141+
#### T17: Single-file preview — root URL accessible
142+
143+
- **Setup:** `plain.qmd` with only markdown content (no code cells)
144+
- **Steps:** `quarto preview plain.qmd --port XXXX --no-browser`, then `curl -s -o /dev/null -w "%{http_code}" http://localhost:XXXX/`
145+
- **Expected:** HTTP 200. Browse URL prints `http://localhost:XXXX/` (no filename appended).
146+
- **Catches:** `projectHtmlFileRequestHandler` used for single files (defaultFile=`index.html` instead of output filename), or `previewInitialPath` returning filename instead of `""`
147+
148+
#### T18: Single-file preview — named output URL also accessible
149+
150+
- **Setup:** Same `plain.qmd`
151+
- **Steps:** `quarto preview plain.qmd --port XXXX --no-browser`, then `curl -s -o /dev/null -w "%{http_code}" http://localhost:XXXX/plain.html`
152+
- **Expected:** HTTP 200. The output filename path also serves the rendered content.
153+
- **Catches:** Handler regression where only root or only named path works
154+
155+
### P2: Important
156+
157+
#### T19: Project preview — non-index file URL correct
158+
159+
- **Setup:** Website project with `_quarto.yml`, `index.qmd`, and `about.qmd`
160+
- **Steps:** `quarto preview --port XXXX --no-browser`, navigate to `http://localhost:XXXX/about.html`
161+
- **Expected:** HTTP 200. Browse URL may include path for non-index files in project context.
162+
- **Catches:** `isSingleFile` guard accidentally excluding real project files from path computation
163+
135164
## Test File Templates
136165

137166
**Minimal Python .qmd:**

0 commit comments

Comments
 (0)