@@ -14,7 +14,25 @@ import type { Page, Route } from "@playwright/test";
1414 * patterns.
1515 */
1616
17- const ALL_TOOL_IDS = [
17+ /**
18+ * URL-path slugs for backend endpoints under `/api/v1/`. Used only to seed
19+ * the stub responses for `endpoints-availability` and `endpoints-enabled`
20+ * so the React app sees a populated map at startup.
21+ *
22+ * NOTE: this is *not* the frontend tool-registry IDs and several entries
23+ * here have already drifted from the real registry endpoints (e.g. `merge`
24+ * vs `merge-pdfs`, `compress` vs `compress-pdf`, `ocr` vs `ocr-pdf`).
25+ * Tests still pass because the frontend's `useEndpointConfig` defaults
26+ * absent keys to `enabled: true`, so a wrong key is functionally the same
27+ * as a missing key — every endpoint reports enabled either way.
28+ *
29+ * TODO: derive this from `getAllApplicationEndpoints(registry, …)` instead
30+ * of hand-maintaining it. That requires extracting endpoint metadata out of
31+ * `useTranslatedToolRegistry` (currently a React hook with deep i18n + tool
32+ * component imports — can't be called from Node-side Playwright setup) into
33+ * a pure-data module both the hook and this helper can import.
34+ */
35+ const ALL_BACKEND_ENDPOINTS = [
1836 "pdf-to-img" ,
1937 "img-to-pdf" ,
2038 "pdf-to-word" ,
@@ -73,10 +91,28 @@ const ALL_TOOL_IDS = [
7391 "remove-blanks" ,
7492 "remove-annotations" ,
7593 "remove-image" ,
94+ "extract-pages" ,
95+ "reorganize-pages" ,
96+ "extract-images" ,
97+ "add-stamp" ,
98+ "add-attachments" ,
99+ "change-metadata" ,
100+ "overlay-pdfs" ,
101+ "get-pdf-info" ,
102+ "validate-signature" ,
103+ "timestamp-pdf" ,
104+ "replace-color" ,
105+ "show-j-s" ,
106+ "booklet-imposition" ,
107+ "pdf-text-editor" ,
108+ "form-fill" ,
109+ "multi-tool" ,
110+ "read" ,
111+ "automate" ,
76112] ;
77113
78114const DEFAULT_ENDPOINTS_AVAILABILITY = Object . fromEntries (
79- ALL_TOOL_IDS . map ( ( k ) => [ k , { enabled : true } ] ) ,
115+ ALL_BACKEND_ENDPOINTS . map ( ( k ) => [ k , { enabled : true } ] ) ,
80116) ;
81117
82118export interface MockAppApiOptions {
0 commit comments