Skip to content

test: add coverage for includeStatus parameter - #1293

Open
3rabiii wants to merge 1 commit into
OneBusAway:mainfrom
3rabiii:fix-trips-for-route-gap11
Open

test: add coverage for includeStatus parameter#1293
3rabiii wants to merge 1 commit into
OneBusAway:mainfrom
3rabiii:fix-trips-for-route-gap11

Conversation

@3rabiii

@3rabiii 3rabiii commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR addresses the missing test coverage for the includeStatus query parameter in the trips-for-route handler.

Changes Made

  • Added a new table-driven test TestTripsForRouteHandler_StatusInclusion in internal/restapi/trips_for_route_handler_test.go.
  • The test explicitly verifies that:
    • includeStatus=false correctly omits the status object from the response entries.
    • includeStatus=true (or omitted) correctly includes the populated status object.

Closes: #1292

Summary by CodeRabbit

  • Tests
    • Added coverage to verify trip responses correctly include or omit status information based on the includeStatus setting.
    • Confirmed default and explicitly enabled behavior returns valid status details for active trips.

Add table-driven test TestTripsForRouteHandler_StatusInclusion to verify
that the includeStatus query parameter correctly omits or includes the
status object in the response
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b512cca8-e904-4f0f-a89a-ca5bc8fde5dc

📥 Commits

Reviewing files that changed from the base of the PR and between 3b73fd9 and 9268bda.

📒 Files selected for processing (1)
  • internal/restapi/trips_for_route_handler_test.go

📝 Walkthrough

Walkthrough

Added table-driven tests for the trips-for-route handler. The tests verify default, explicit, and disabled includeStatus behavior, including valid status phases and omitted status data.

Changes

Trips-for-route status behavior

Layer / File(s) Summary
Status inclusion test coverage
internal/restapi/trips_for_route_handler_test.go
Adds table-driven cases for default and explicit includeStatus inclusion and for includeStatus=false. The tests verify populated status data, active trip IDs, valid phases, and omitted status data.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: ahmedhossamdev, burma-shave, aaronbrethorst

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the added test coverage for the includeStatus parameter.
Linked Issues check ✅ Passed The test covers omitted, enabled, and disabled includeStatus behavior and verifies status omission or populated status data as required by [#1292].
Out of Scope Changes check ✅ Passed The pull request changes only the handler test file and adds coverage directly related to the linked issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

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.

Missing test coverage for includeStatus in trips-for-route handler

1 participant