Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions admin/templates/page_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
<span>Body <em class="hint">Markdown</em></span>
<textarea name="body_markdown" rows="18">{{ page.body_markdown }}</textarea>
</label>
<div class="field field--inline">
<label class="field field--inline">
<span>Status</span>
<select name="status">
<option value="draft"{% if page.status == 'draft' %} selected{% endif %}>Draft</option>
<option value="published"{% if page.status == 'published' %} selected{% endif %}>Published</option>
</select>
</div>
</label>
<div class="form__actions">
<button class="btn btn--primary" type="submit">Save page</button>
<a class="btn btn--ghost" href="/admin/pages">Cancel</a>
Expand Down
4 changes: 2 additions & 2 deletions admin/templates/post_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
<span>Body <em class="hint">Markdown — **bold**, *italic*, [links](/x), lists, `code`</em></span>
<textarea name="body_markdown" rows="18">{{ post.body_markdown }}</textarea>
</label>
<div class="field field--inline">
<label class="field field--inline">
<span>Status</span>
<select name="status">
<option value="draft"{% if post.status == 'draft' %} selected{% endif %}>Draft</option>
<option value="published"{% if post.status == 'published' %} selected{% endif %}>Published</option>
</select>
</div>
</label>
<div class="form__actions">
<button class="btn btn--primary" type="submit">Save post</button>
<a class="btn btn--ghost" href="/admin/posts">Cancel</a>
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ program argument, for example:
wfl --test tests/integration/server-port.test.wfl /absolute/path/to/wfl
wfl --test tests/integration/authentication.test.wfl /absolute/path/to/wfl
wfl --test tests/integration/content-users.test.wfl /absolute/path/to/wfl
wfl --test tests/integration/editor-labels.test.wfl /absolute/path/to/wfl
wfl --test tests/integration/media.test.wfl /absolute/path/to/wfl
wfl --test tests/integration/throttle.test.wfl /absolute/path/to/wfl
wfl --test tests/integration/recovery.test.wfl /absolute/path/to/wfl
Expand Down Expand Up @@ -46,6 +47,7 @@ all response-header values. Tests manage synthetic cookies explicitly.
| `server-port.test.wfl` | Original Python cases: configured ephemeral port, missing setting, absent config; exact startup URLs, installer status/content type/form/CSRF. |
| `authentication.test.wfl` | Installer CSRF and input rejection without mutation, first admin/session creation, setup locking, login response cookie flags, invalid credentials, CSRF, logout methods, and expired sessions. |
| `content-users.test.wfl` | Draft/publication, escaped title and rendered Markdown, pagination, page navigation/update/delete, mutation methods, CSRF, author ownership, admin user/settings boundaries, password update, account removal and revoked access. |
| `editor-labels.test.wfl` | New page and post forms: the Status text and `select name="status"` share one `label.field.field--inline`. A second program argument selects an older application tree for the red run. |
| `media.test.wfl` | Configured and legacy storage, generated safe names, byte retrieval, missing/wrong CSRF, extension/empty/malformed/oversized rejection, author denial, method enforcement, database/file consistency on deletion. |
| `throttle.test.wfl` | Exactly ten failed credentials, next request blocked, persistence across restart, expired-window recovery and successful-login clearing. |
| `recovery.test.wfl` | Stopped-site database-plus-upload backup, restart, actual restore after a later change, HTTP content/media and login, SQLite integrity and foreign-key checks. |
Expand Down
39 changes: 39 additions & 0 deletions tests/integration/editor-labels.test.wfl
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
include from "fixtures/http-helpers.wfl"

// Implicit label: the Status text and status select share one label element.
define action called editor_inline_label with parameters html_text:
store open_marker as "<label class=\"field field--inline\">"
store open_at as indexof of html_text and open_marker
expect open_at is greater than or equal to 0 to be yes
store label_tail as substring of html_text and open_at and ((length of html_text) minus open_at)
store close_at as indexof of label_tail and "</label>"
expect close_at is greater than 0 to be yes
return substring of label_tail and 0 and close_at
end action

describe "Editor status labels through HTTP":
test "new page and post status selects sit inside the Status label":

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Regression and UI checks remain unverified

The PR records no Red/Green run or browser checks for the changed forms. Testing policy requires regression evidence and UI checks require keyboard, focus, label, and narrow-screen verification before merge.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

store site_spec as http_new_site of "configured"
try:
store running_site as http_launch of site_spec
try:
store admin_cookie as http_install of site_spec
for each editor_route in ["/admin/pages/new", "/admin/posts/new"]:
store editor_reply as http_get of site_spec and editor_route and admin_cookie
expect editor_reply["status"] to equal 200
store label_html as editor_inline_label of editor_reply["body"]
expect label_html to contain "<span>Status</span>"
expect label_html to contain "<select name=\"status\">"
expect label_html to contain "value=\"draft\""
expect label_html to contain "value=\"published\""
expect label_html contains "<select name=\"role\">" to be no
expect label_html contains "type=\"file\"" to be no
end for
finally:
call http_stop with running_site
end try
finally:
call http_destroy with site_spec
end try
end test
end describe
Loading