From 1c7467d7ca7a3b4d73d1bd7a45b1e3257181aa3f Mon Sep 17 00:00:00 2001 From: shuhuNB515 Date: Sun, 29 Nov 2026 20:38:32 +0800 Subject: [PATCH] ci(web): run the four src/lib test files no script named activity-merge, chat-mentions, format and http-href had tests on disk that pass, but no package.json script named them and the web job runs each script by name, so their 15 assertions could not fail a build. http-href is the guard that refuses javascript:, data: and vbscript: URLs before they reach an href, so a regression there was an unenforced XSS vector. Add one script per file, matching the existing shape, and one web job step per script. Closes #678. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++++ CHANGELOG.md | 1 + web/package.json | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1862eb71..c71f3dce2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -220,6 +220,10 @@ jobs: - run: npm run test:chat-filter - run: npm run test:bash - run: npm run test:openai-compatible + - run: npm run test:activity-merge + - run: npm run test:chat-mentions + - run: npm run test:format + - run: npm run test:http-href - run: npm run build:static python: diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b3257d4d..ca014da4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project are documented in this file. The format is b ### Added +- **The last four `src/lib` test files run in CI**: `activity-merge`, `chat-mentions`, `format` and `http-href` existed and passed, but no `package.json` script named them and the `web` job runs scripts by name, so their 15 assertions could not fail a build. `test:activity-merge`, `test:chat-mentions`, `test:format` and `test:http-href` now match the existing one-script-per-file shape and run in the `web` job; `http-href` is the guard that refuses `javascript:`, `data:` and `vbscript:` URLs before they reach an href (#678). - **Custom OpenAI-compatible preset in the LLM profile form** (#677): the format selector offers "Custom OpenAI-compatible", which selects the existing `openai` format and shows the expected base-URL shape (`https:///v1`) with a one-line hint. It is UI-only: no vendor host, no schema change, and nothing is prefilled, so an empty base URL keeps the documented public fallback. The preset is re-derived from the saved base URL when a profile reopens, and tests pin the base-URL normalization (bare `/v1`, trailing slash, a pasted `/chat/completions`, whitespace, path prefix, host:port). - **Opt-in SELinux overlay for bind mounts**: `docker-compose.selinux.yml` layers private `:Z` labels on `./data`, `./keys` and `./skills` for hosts with SELinux enforcing. The base file keeps its unlabelled mounts, so the overlay is opt-in and a shared `:z` label never lets another container read the encryption keys (#632). - **Browser back and forward across console views** (#641): page navigation is represented in query parameters (`tab`, `view`, `c`, `path`, and the inspector record parameters), so a user action pushes a history entry and back and forward restore the view. The native history API integrates with the Next router and a stable server snapshot keeps the static export working. Inspector payloads stay in memory and are never written to the URL or to browser storage. `npm run test:navigation` covers the history logic and now runs in CI. diff --git a/web/package.json b/web/package.json index 721a63da4..b5ef31bc4 100644 --- a/web/package.json +++ b/web/package.json @@ -24,7 +24,11 @@ "test:auth": "node --test scripts/auth.test.mjs", "test:navigation": "node --test src/lib/navigation.test.mjs", "test:chat-filter": "node --test src/lib/chat-agent-filter.test.mjs", - "test:openai-compatible": "node --test src/lib/openai-compatible.test.mjs" + "test:openai-compatible": "node --test src/lib/openai-compatible.test.mjs", + "test:activity-merge": "node --test src/lib/activity-merge.test.mjs", + "test:chat-mentions": "node --test src/lib/chat-mentions.test.mjs", + "test:format": "node --test src/lib/format.test.mjs", + "test:http-href": "node --test src/lib/http-href.test.mjs" }, "lint-staged": { "*.{js,ts,jsx,tsx}": [