Make Aniimo unknown-role tests self-contained
Some checks failed
Validate and deploy Sokko G / validate (push) Failing after 13m22s
Validate and deploy Sokko G / deploy (push) Has been skipped

This commit is contained in:
Shinuwa 2026-10-30 10:25:23 +01:00
parent d2577d8e51
commit 9c8c2cf305

View file

@ -48,13 +48,17 @@ test("validation requires regional uids and explicitly documented unknown roles"
entry.uid = entry.id;
assert.throws(() => validateAniimoData([entry], [fr, en]), /uid must combine/);
assert.throws(() => validateAniimoData([aniimos[0], aniimos[0]], [fr, en]), /Duplicate Aniimo uid/);
const pending = structuredClone(aniimos.find((v) => v.variations.some((form) => form.role === null)));
const pending = structuredClone(aniimos[0]);
pending.variations[0].role = null;
pending.variations[0].verification = "pending";
pending.variations[0].data_gaps = ["role_not_verified"];
validateAniimoData([pending], [fr, en]);
const pendingData = prepareAniimoData([pending], fr, en);
delete pending.variations.find((v) => v.role === null).data_gaps;
assert.throws(() => validateAniimoData([pending], [fr, en]), /Unknown role must/);
assert.ok(!data.filterOptions.roles.includes(null));
assert.ok(filter({ roles: data.filterOptions.roles }).every((v) => v.role !== null));
assert.ok(filter({}).some((v) => v.role === null));
assert.ok(!pendingData.filterOptions.roles.includes(null));
assert.ok(filter({ roles: pendingData.filterOptions.roles }, pendingData.variants).every((v) => v.role !== null));
assert.ok(filter({}, pendingData.variants).some((v) => v.role === null));
});
test("Sparkelf uses only its current French and English names", () => {