mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-14 01:36:14 +00:00
Follow-ups to the merged Ashby careers integration (PR #11590). Type safety - Add FailureCode discriminant ('missing-env' | 'auth' | 'schema' | 'network') to FetchOutcome stale/failed variants. Replaces fragile reason.startsWith() pattern matching in staleAnnotation() with an exhaustive switch. - Harden isRolesSnapshot() to validate departments[].roles is an array. - Fix capitalize() so multi-word department names retain title case (e.g. "Product Engineering" no longer becomes "Product engineering"). - Simplify extractTitle() to drop redundant 'in' check and one as cast. - Extract formatZodIssues() helper, used by both envelope and per-job parse error paths. CI reporter - escapeAnnotation() now escapes % first per GitHub Actions spec. - describeSnapshotAge() returns 'unknown' for future dates instead of collapsing to 'today'. - Extract MS_PER_DAY constant. Tests - Replace 13 inline `as unknown as typeof fetch` casts with a single mockFetch() helper. - Track temp dirs in a Set, clean in afterEach so failed assertions no longer leak directories (was 9 inline rmSync calls). - Add reasonCode assertions across stale/failed cases. - Add network-error retry test, multi-department grouping test, capitalize multi-word test, describeSnapshotAge edge cases (today, 1 day, n days, NaN, future). - Add schema and network stale-annotation tests. - Strengthen 403 test to check status, reason, and reasonCode. - Fix freshOutcome() helper to derive droppedRoles from droppedCount. - Tighten tautological careers.spec.ts filter assertion (toBeLessThanOrEqual -> toBeLessThan). Schema - Document why jobs uses z.unknown() (per-job validation in parseRoles for error isolation). Tests: 30 passing (was 20). Amp-Thread-ID: https://ampcode.com/threads/T-019dc0d6-da09-7654-b22d-16903e2fee71 Co-authored-by: Amp <amp@ampcode.com>