test(audit): add regression proving STATUS_CHANGED/METADATA_UPDATED are excluded
Cheap insurance for the day someone widens the WHERE clause in findRolledUpActivityFeed. Suggested by Sara in PR #288 review cycle 1. Inserts two non-eligible events alongside one TEXT_SAVED and asserts the feed returns the TEXT_SAVED row only. Part of #285. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit was merged in pull request #288.
This commit is contained in:
@@ -135,6 +135,20 @@ class AuditLogQueryRepositoryRolledUpTest {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void rolledUpFeed_excludes_non_eligible_kinds() {
|
||||||
|
insertUserAndDocs();
|
||||||
|
Instant base = Instant.parse("2026-04-20T12:00:00Z");
|
||||||
|
insertAuditEvent(USER_ID, DOC_ID, "STATUS_CHANGED", base);
|
||||||
|
insertAuditEvent(USER_ID, DOC_ID, "METADATA_UPDATED", base.plusSeconds(60));
|
||||||
|
insertAuditEvent(USER_ID, DOC_ID, "TEXT_SAVED", base.plusSeconds(120));
|
||||||
|
|
||||||
|
List<ActivityFeedRow> rows = auditLogQueryRepository.findRolledUpActivityFeed(USER_ID.toString(), 40);
|
||||||
|
|
||||||
|
assertThat(rows).hasSize(1);
|
||||||
|
assertThat(rows.get(0).getKind()).isEqualTo("TEXT_SAVED");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void rolledUpFeed_exposes_count_and_happenedAtUntil_on_singletons_and_rollups() {
|
void rolledUpFeed_exposes_count_and_happenedAtUntil_on_singletons_and_rollups() {
|
||||||
insertUserAndDocs();
|
insertUserAndDocs();
|
||||||
|
|||||||
Reference in New Issue
Block a user