Make Aniimo unknown-role tests self-contained
This commit is contained in:
parent
d2577d8e51
commit
9c8c2cf305
1 changed files with 8 additions and 4 deletions
|
|
@ -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", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue