polish(db): clearer maker label; assert group_key and vocabularies in seed tests

This commit is contained in:
2026-06-02 11:25:10 +02:00
parent adc7c61ee2
commit 5ee9fd88f1
2 changed files with 11 additions and 7 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ pub async fn seed_spectrum_cataloguing(conn: &mut sqlx::PgConnection) -> Result<
kind: Some(AuthorityKind::Person), kind: Some(AuthorityKind::Person),
}, },
"production", "production",
&[("sv", "Tillverkare"), ("en", "Producer")], &[("sv", "Tillverkare"), ("en", "Maker")],
), ),
]; ];
+10 -6
View File
@@ -34,6 +34,7 @@ async fn seed_creates_vocabularies_and_field_definitions(pool: PgPool) {
vocabulary_id: material_vocab.id 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") let place = fields::field_definition_by_key(db.pool(), "production_place")
.await .await
@@ -83,10 +84,13 @@ async fn seed_is_idempotent(pool: PgPool) {
.len(), .len(),
12 12
); );
assert!( for key in ["material", "object_name", "technique"] {
vocab::vocabulary_by_key(db.pool(), "material") assert!(
.await vocab::vocabulary_by_key(db.pool(), key)
.unwrap() .await
.is_some() .unwrap()
); .is_some(),
"vocabulary {key} should remain after re-seeding"
);
}
} }