Align audit UI tests with empty-state model

This commit is contained in:
Joe Julian
2026-04-01 17:17:28 -07:00
parent 004a0278a7
commit 99a581674d
+4 -4
View File
@@ -678,16 +678,16 @@ func TestUIAPIAuditMessagesGuideQuickFilters(t *testing.T) {
u := newUIWithSession("desktop", &session.Manager{})
u.showAPIAuditSection()
if got := u.listEmptyMessage(); got != "No API audit events yet. Connect a trusted client, respond to approval prompts, or issue a token to start recording activity." {
t.Fatalf("listEmptyMessage() = %q, want updated API audit guidance", got)
if got := u.listEmptyState(); got.Title != "No API audit events yet" || got.Body != "Connect a trusted client, respond to approval prompts, or issue a token to start recording activity." {
t.Fatalf("listEmptyState() = %#v, want updated API audit guidance", got)
}
if got := u.detailPlaceholderMessage(); got != "Select an audit event to inspect it, or use Search vault or the quick filters above." {
t.Fatalf("detailPlaceholderMessage() = %q, want quick-filter guidance", got)
}
u.search.SetText("allowed")
if got := u.listEmptyMessage(); got != `No audit events match "allowed". Clear the search or try a different quick filter.` {
t.Fatalf("listEmptyMessage() with search = %q, want quick-filter empty-state guidance", got)
if got := u.listEmptyState(); got.Title != "No matching audit events" || got.Body != `No audit events match "allowed". Clear the search or try a different quick filter.` {
t.Fatalf("listEmptyState() with search = %#v, want quick-filter empty-state guidance", got)
}
}