From 5ee9fd88f187530949eae7a4a8ed20ae223c1569 Mon Sep 17 00:00:00 2001 From: Anders Olsson Date: Tue, 2 Jun 2026 11:25:10 +0200 Subject: [PATCH] polish(db): clearer maker label; assert group_key and vocabularies in seed tests --- crates/db/src/seed.rs | 2 +- crates/db/tests/seed.rs | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/crates/db/src/seed.rs b/crates/db/src/seed.rs index dfb7c0b..9c5febf 100644 --- a/crates/db/src/seed.rs +++ b/crates/db/src/seed.rs @@ -100,7 +100,7 @@ pub async fn seed_spectrum_cataloguing(conn: &mut sqlx::PgConnection) -> Result< kind: Some(AuthorityKind::Person), }, "production", - &[("sv", "Tillverkare"), ("en", "Producer")], + &[("sv", "Tillverkare"), ("en", "Maker")], ), ]; diff --git a/crates/db/tests/seed.rs b/crates/db/tests/seed.rs index 821927d..b8064e3 100644 --- a/crates/db/tests/seed.rs +++ b/crates/db/tests/seed.rs @@ -34,6 +34,7 @@ async fn seed_creates_vocabularies_and_field_definitions(pool: PgPool) { vocabulary_id: material_vocab.id } ); + assert_eq!(material_field.group_key.as_deref(), Some("description")); let place = fields::field_definition_by_key(db.pool(), "production_place") .await @@ -83,10 +84,13 @@ async fn seed_is_idempotent(pool: PgPool) { .len(), 12 ); - assert!( - vocab::vocabulary_by_key(db.pool(), "material") - .await - .unwrap() - .is_some() - ); + for key in ["material", "object_name", "technique"] { + assert!( + vocab::vocabulary_by_key(db.pool(), key) + .await + .unwrap() + .is_some(), + "vocabulary {key} should remain after re-seeding" + ); + } }