test: add test coverage for DB, file handlers, CSV/ODS, and API endpoints #86
Reference in New Issue
Block a user
Delete Branch "test-coverage-batch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves #75, #76, #77, #78.
Summary
51 new test functions across 9 new files, 0 production code changes.
#75 — DB edge-case tests
internal/db/items_edge_test.go(10 tests): duplicate part number, hard delete, pagination, search, revision status/labels/compare/rollback, project-item associationsinternal/db/item_files_test.go(4 tests): file CRUD operations#76 — File handler tests
internal/api/file_handlers_test.go(8 tests): list/delete files via DB, cross-item guard, storage-unavailable error paths (presign, upload, associate, thumbnail)#77 — CSV/ODS handler tests
internal/api/csv_handlers_test.go(6 tests): export empty/with items, template, import dry-run/commit, BOM CSV exportinternal/api/ods_handlers_test.go(3 tests): export, template, project sheet#78 — API endpoint tests
internal/api/revision_handlers_test.go(8 tests): list, get, create, update, compare, rollback, not-found pathsinternal/api/schema_handlers_test.go(4 tests): list, get, form descriptor, not-foundinternal/api/audit_handlers_test.go(4 tests): completeness summary/detail, not-foundinternal/api/auth_handlers_test.go(4 tests): current user, auth config, token lifecycleBug fix
createItemDirecthelper:StandardCostfield was removed fromItemstruct, now passes cost as revision property instead