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),
},
"production",
&[("sv", "Tillverkare"), ("en", "Producer")],
&[("sv", "Tillverkare"), ("en", "Maker")],
),
];
+6 -2
View File
@@ -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
);
for key in ["material", "object_name", "technique"] {
assert!(
vocab::vocabulary_by_key(db.pool(), "material")
vocab::vocabulary_by_key(db.pool(), key)
.await
.unwrap()
.is_some()
.is_some(),
"vocabulary {key} should remain after re-seeding"
);
}
}