[Master] Expense Agent - Added Automated Test For API Pages - #10081
[Master] Expense Agent - Added Automated Test For API Pages#10081v-rohangarg20 wants to merge 2 commits into
Conversation
Good Sense Reviewer - Round 1Recommendation: Accept with SuggestionsWhat this PR doesThis adds a new integration test codeunit for Expense Agent API pages and a small helper for appending $expand to API URLs. The read and expand tests mostly use committed test records and real API GET calls, and several action tests assert the resulting status changes. The action tests target the published service-enabled procedure names, and the remaining points are test-quality improvements rather than blockers. Problem-solution fitFit: Strong The reported scenario is a missing automated coverage gap for Expense Agent API pages. The diff is clearly test-only and is aimed at that gap, with useful end-to-end checks for visibility, expansions, and service-enabled actions. SuggestionsS1 (🟠 Moderate): Assert violations are fully cleared S2 (🟠 Moderate): Send typed action payload values S3 (🟠 Moderate): Reset committed data per test Risk assessment and necessityRisk: This is test-only, so there is no direct product behavior or upgrade risk. The risk is in the validation signal: partial cleanup and weaker assertions can make the suite flaky or give false confidence about some API behavior. Necessity: The coverage is useful because these API pages are an automation contract for the Expense Agent. The scope is appropriate for a test-only change, and the remaining findings are improvements that should be considered without blocking the PR.
|
|
Fixes AB#637260
Summary
Adds comprehensive automated integration tests for all Expense Agent API pages, validating API exposure, data retrieval, field accuracy, and related-entity expansion.
Changes
src/Apps/W1/ExpenseAgent/test/src/API/ExpenseAPIPagesTest.Codeunit.al: ~1,300 lines, 40+ test methods covering expense categories, subcategories, groups, expenses, itemizations, participants, rules, and posted reports.VerifyRecordVisibleInApi().$expandfor related entities (expenseItemizations, expenseParticipants, expenseRuleViolations).ExpenseTestHandler.Type of change