From c9ffba4ce4b531cf5abe1ea957af52f28c73fdcc Mon Sep 17 00:00:00 2001 From: Trezy Date: Tue, 24 Feb 2026 16:04:33 -0600 Subject: [PATCH] test: fix the stats test --- tests/e2e_admin.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/e2e_admin.rs b/tests/e2e_admin.rs index d8f3799..d87a742 100644 --- a/tests/e2e_admin.rs +++ b/tests/e2e_admin.rs @@ -397,6 +397,20 @@ async fn stats_with_seeded_records() { let app = TestApp::new().await; app.mock_admin_userinfo().await; + // Seed a lexicon so the stats query can join against it + sqlx::query( + "INSERT INTO lexicons (id, lexicon_json) VALUES ($1, $2)", + ) + .bind("test.collection") + .bind(serde_json::json!({ + "lexicon": 1, + "id": "test.collection", + "defs": { "main": { "type": "record", "key": "tid", "record": { "type": "object", "properties": {} } } } + })) + .execute(&app.state.db) + .await + .unwrap(); + // Seed records directly sqlx::query( "INSERT INTO records (uri, did, collection, rkey, record, cid) VALUES ($1, $2, $3, $4, $5, $6)", -- 2.51.2