You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(client): schema-complete mock editor with a form/YAML toggle
Rework mock creation and make the visual editor cover the whole mock format:
- Extract the creation drawer to NewMock and mount it on both Mocks and History;
History's 'Create a new mock from entry' now opens it in place (no navigation).
- Toggle between the visual form and raw YAML: the YAML is the source of truth,
and switching to the form is gated on it being a single mock valid against the
schema (ajv). Validate before saving and keep the drawer open on error so the
mock is never lost. Drop the now-redundant read-only preview.
- Complete the form vs the schema: response/proxy delay (fixed or random), all 17
matchers, every HTTP method plus method-as-matcher, path and body matchers for
all methods, multi-value query/header keys, numeric/bool values coerced to
strings. Reverse conversion (mock -> form) with round-trip tests.
- Keep pagination in the URL (?page/?page-size) so a page is shareable, with
directional page scroll; the mock link preserves ?session and back returns to
the list.
- Only sync the ?session param on /pages/* routes so it no longer clobbers the
'*' -> /pages/history redirect (which left the root on a blank page).
Tests: vitest 64 (conversion, rendered component, YAML validation, utils) and the
Playwright TNR grows to 22. New deps (pinned, audit-clean): ajv (runtime), and
@testing-library/react + user-event (dev).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments