Conversation
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM — Thorough integration test suite that follows established project patterns (beforeEach with truncateAll/seedOrg/seedProject, consistent use of seedTriggerConfig helper). All 10 repository functions are well-covered with 32 test cases spanning CRUD, upsert conflict resolution, bulk operations, JSONB round-trips, cascade deletes, and cross-project isolation. CI is green across all checks.
One minor stylistic note (not blocking): the cascade delete test uses dynamic await import(...) for getDb, projects, and eq (lines 497-499) while all other integration tests use static imports at the top of the file. This works correctly but is inconsistent with the rest of the test suite. Not worth holding up the PR.
🕵️ claude-code · claude-opus-4-6 · run details
Summary
tests/integration/db/agentTriggerConfigsRepository.test.ts) covering all repository functions foragentTriggerConfigsbeforeEachwithtruncateAll()+seedOrg()+seedProject(), usesseedTriggerConfig()helper fromtests/integration/helpers/seed.tsTest coverage
upsertTriggerConfigcreates new records with correct defaults;getTriggerConfig/getTriggerConfigByIdretrieve by composite key and primary key;updateTriggerConfigmodifiesenabledandparameters;deleteTriggerConfigremoves by ID and returns boolean(projectId, agentType, triggerEvent)updates the existing row instead of creating a duplicatebulkUpsertTriggerConfigsinserts/updates multiple configs in a single transaction; handles empty input gracefully{ authorMode, threshold, nested: { labels, priority }, flag }) persist and read back correctly through bothupsertTriggerConfigandupdateTriggerConfiggetTriggerConfigsByProject,getTriggerConfig,getTriggerConfigsByProjectAndAgent, anddeleteTriggerConfigsByProjectall scope results to the specified projectTest plan
Trello card: https://trello.com/c/7Gw8RnEY/418-as-a-developer-i-want-integration-tests-for-agenttriggerconfigsrepository-so-that-crud-upsert-conflicts-bulk-operations-and-cros
🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details