Skip to content

test(api): add appointment endpoint tests#12419

Open
miguelm-montano wants to merge 1 commit into
openemr:masterfrom
miguelm-montano:test/appointment-api-coverage
Open

test(api): add appointment endpoint tests#12419
miguelm-montano wants to merge 1 commit into
openemr:masterfrom
miguelm-montano:test/appointment-api-coverage

Conversation

@miguelm-montano

Copy link
Copy Markdown

Assisted-By: Claude Code

Short description of what this changes or resolves:

Adds API test coverage for the Standard REST Appointment resource, addressing gaps in the API test suite. Currently only 30/172 route+method combinations have tests.

Contributes to #12343

Changes proposed in this pull request:

  • Created tests/Tests/Api/AppointmentApiTest.php with tests for:
    • GET /api/appointment (list all appointments)
    • GET /api/appointment/:eid (get single appointment by ID)
    • Proper error handling (404 for missing ID, 401 for unauthorized)
    • Follows the FacilityApiTest pattern as suggested in the coverage gap issue

Coverage impact:

  • Before: 30/172 route+method combinations tested (17%)
  • After: 32/172 route+method combinations tested (18.6%)

Was an AI assistant used? Yes / No

Yes

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 23.91%. Comparing base (32c99ba) to head (50f4818).
⚠️ Report is 6 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #12419      +/-   ##
============================================
- Coverage     24.17%   23.91%   -0.26%     
- Complexity    84094    84101       +7     
============================================
  Files          3934     3935       +1     
  Lines        417183   417231      +48     
============================================
- Hits         100835    99773    -1062     
- Misses       316348   317458    +1110     
Flag Coverage Δ
apache 15.48% <100.00%> (-0.08%) ⬇️
api 3.77% <100.00%> (-0.05%) ⬇️
api-tests 3.77% <100.00%> (-0.03%) ⬇️
e2e 9.11% <0.00%> (-0.32%) ⬇️
e2e-tests 9.11% <0.00%> (-0.33%) ⬇️
email 0.18% <0.00%> (-0.01%) ⬇️
isolated-php8.2 7.60% <0.00%> (-0.01%) ⬇️
isolated-php8.3 7.60% <0.00%> (-0.01%) ⬇️
isolated-php8.4 7.60% <0.00%> (-0.01%) ⬇️
isolated-php8.5 7.60% <0.00%> (-0.01%) ⬇️
isolated-php8.6 7.60% <0.00%> (-0.01%) ⬇️
mariadb10.11.18 ?
mariadb10.6.27 ?
mariadb11.4.12 ?
mariadb11.8.8 15.48% <100.00%> (-0.31%) ⬇️
mariadb12.2.2 ?
mysql5.7.44 ?
mysql8.0.46 ?
mysql8.4.9 ?
mysql9.3.0 ?
nginx ?
php8.2 15.48% <100.00%> (+3.13%) ⬆️
php8.3 ?
php8.4 ?
php8.5 ?
services 5.13% <0.00%> (-0.02%) ⬇️
upgrade ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant