Files
raven-test-integration/claude.md
2026-03-02 15:51:01 -08:00

100 lines
4.5 KiB
Markdown

# Integration Test Project Context
## What This Is
Integration test project for the AyaNova v8 API. Tests target .NET 8 and run against a locally running server (`http://localhost:7575`).
Run with:
```
dotnet test raven-integration.csproj
```
## Current Status (March 2026)
The initial triage and rebuild is complete. The project now compiles against net8.0, old broken tests have been removed or rewritten, and new gap-coverage tests have been added. All tests pass except three that are blocked by known server-side bugs:
- **CustomerWithWorkorders_cannotbedeleted** — server returns 500 instead of 400 (case 4653)
- **ContractCrud.CRUD** — minor server-side issue (tracked separately)
- **DirectMessage_SendAndDelete** - server issue prevents delivery as considered a "duplicate" incorrectly. (case 4654)
These are intentionally left failing until server-side fixes are applied as part of the refactor phase. Except the directMessage test is set to skip as it has a 65 second timeout that would slow down testing unnecessarily.
## What Is Covered
### Tier 1 (Critical) — Complete
- **DataList** — `DataList/DataListOperations.cs`
- Saved filter CRUD (create, list, update visibility, delete, confirm deleted)
- Default filter creation blocked by API
- String filtering: contains, starts-with, equals, not-equal
- Date filtering: range (GT/LT), relative keywords (*yesterday*, *tomorrow*, *thisyear*, *NULL*)
- Multi-column AND filter
- Sort ascending and descending on date column
- Pagination (offset/limit, totalRecordCount consistency, non-overlapping pages)
- Column view CRUD (custom column order round-trip)
- Rights enforcement (user with no roles gets 403)
- **Quote** — `Quote/QuoteCrud.cs`
- Header CRUD + concurrency violation + id-from-number lookup
- QuoteItem CRUD
- QuoteItemLabor sub-type CRUD
- **Customer** — `Customer/CustomerCrud.cs`
- CRUD + concurrency violation + alert retrieval
- Referential integrity: customer with linked work order cannot be deleted (test exists; server bug pending fix)
### Tier 2 (Important) — Complete
- **Contract** — `Contract/ContractCrud.cs` — CRUD + concurrency
- **PM** — `PM/PMCrud.cs` — header CRUD + PMItem + concurrency + id-from-number
- **Authorization** — `Authentication/AuthRights.cs` — unauthenticated 401, unauthorized 403
- **Schedule** — `Schedule/ScheduleReads.cs` — service schedule + personal schedule reads
- **Part** — `Part/PartCrud.cs` — CRUD + concurrency + serial numbers round-trip
### Tier 3 (Reference Data / Nice to Have) — Complete
- **Vendor** — `Vendor/VendorCrud.cs` — CRUD + concurrency + alert
- **ServiceRate / TravelRate / TaxCode** — `Reference/ReferenceCrud.cs` — CRUD + concurrency
- **Unit / UnitModel** — `Unit/UnitCrud.cs` — CRUD for both types
- **Memo** — `Memo/MemoCrud.cs` — create + read + delete
- **Notification** — `Notification/NotificationOps.cs` — count, list, send, delete
### Already Covered (from original tests)
- User CRUD, concurrency, password change, inactive user login
- Project CRUD and concurrency
- WorkOrder + nested items/parts/labor/units CRUD
- Attachments (upload/download/delete/authorization)
- Search (phrase, wildcard, tags, serial, deletion cleanup)
- Custom forms
- Pick lists
- Translations
- Event log (object log, user log, pagination)
- Tag bulk operations
- Server health, metrics, log files
- Global biz settings (fetch + round-trip PUT)
## What Is Intentionally Not Covered
- **Report generation** — async job pattern with polling; deferred
- **Stock level updates** — require seeded warehouse IDs not known at test time
- **Auth roles deep test** — role-change behavioral tests; the existing AuthRights.cs covers the critical 401/403 paths
- **EnumList, Name lookup** — low-risk reference reads; not needed for refactor protection
## Known Configuration
- API base: `http://localhost:7575/api/v8/`
- Seeded logins: `superuser` (password: `l3tm3in`), `BizAdmin`, `OpsAdmin`, `SubContractorRestricted`
- Seeded customer id=1 is always safe to reference
- Time zone adjustment for date filters: -7 (see `util.cs` `TIME_ZONE_ADJUSTMENT`)
- DataList class names ARE the list keys (e.g., `WorkOrderDataList`, `CustomerDataList`)
## What Comes Next (Refactor Phase)
This test suite exists to protect against regressions during the Step D refactor. Before starting the refactor:
1. Confirm all tests pass (except the three known server bugs above)
2. Fix the three server-side bugs (case 4653, case 4654 and contract issue)
3. Then proceed with the Step D refactor — tests will catch regressions