test: mocked e2e coverage for outpatient prioritization and custom forms - #620
Conversation
Adds two mocked-backend suites for features that had no e2e coverage: - tests/mocked/outpatient — the PRIMARYCARE patient list: default filter payload, department options following the selected segment, secondary filter badge/payload, marcadores expansion, the client-side search and the failure path. - tests/mocked/customForms — evolution forms: list counters, save payload for an edit and for a duplicate, required-field and unique-id validation, options cleared on a question type change, and the MAINTAINER-only JSON import. Also lists the new folders in the CLAUDE.md test tree. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RQpzfg94gWWra1P8gmibhv
There was a problem hiding this comment.
This PR successfully adds comprehensive test coverage for two previously untested features: outpatient prioritization and custom forms. The mocked E2E test suite now includes 15 new test cases (6 for outpatient prioritization, 9 for custom forms) that cover key workflows including filtering, validation, CRUD operations, and error handling.
The tests are well-structured, follow repository patterns, and appropriately use fictitious test data as required by the project guidelines. All changes are test-only additions with no production code modifications, making this a low-risk enhancement to the test suite.
The documentation update to CLAUDE.md correctly reflects the new test directory structure. Ready to merge.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
Extends the mocked e2e suite to two features that had no coverage at all.
tests/mocked/outpatient/outpatientPrioritization.spec.tsThe PRIMARYCARE patient list (
/pacientes-ambulatoriais,src/features/outpatient). 6 tests:POST /patient/liston mount (including the hardcodedidSegment: 1), the resolved patient names fromPOST /names, the observation column showing only the first paragraph, the formatted scheduled date, and the row action opening/prescricao/:idin a new tab;appointment/tags;POST /patient/listreporting the error and leaving the empty state.tests/mocked/customForms/customForms.spec.tsEvolution forms (
/configuracoes/forms-personalizados,src/features/memory/CustomForms). 9 tests:PUT /memory/custom-forms/:idwith the complete record, success notification and navigation back to the list;optionsin the saved payload;new?copyFrom=<key>, prefilling "Cópia de …" and saving as a new record (PUT /memory/custom-forms, no id in the path);MAINTAINER, a pasted JSON replacing the form under edit (still saved under the record's own id), and an invalid JSON rejected without touching the form.Notes
make e2e-mock/e2e-mock.ymlworkflow. Verified locally with--repeat-each=2: 30/30 green.CustomFormEditorPage/FormBody, the "Verifique os campos obrigatórios antes de salvar." notification and the automatic jump to the first failing group never fire on the first failed save — the effect depends only onsubmitCount, so it reads Formik'serrorsone render too early and bails out; it works from the second attempt on. Addingerrorsto the effect deps would fix it. The tests assert the field-level errors and the absence of the save request instead, so they stay valid either way.Co-Authored-By: Claude Opus 5 noreply@anthropic.com
🤖 Generated with Claude Code
https://claude.ai/code/session_01RQpzfg94gWWra1P8gmibhv
Generated by Claude Code