Add some more tests to ensure rejection of nonsense

This commit is contained in:
zkldi
2021-12-11 23:51:29 +00:00
parent e79220b038
commit cc107df081
@@ -46,6 +46,23 @@ t.test("#ParseLR2Hook", (t) => {
dm({ scoreData: { unexpectedField: "foo" } }),
"Should allow excess keys inside scoreData that we do not recognise."
);
assertSuccess(
dm({ playerData: { unexpectedField: "foo" } }),
"Should allow excess keys inside playerData that we do not recognise."
);
assertFail(
dm({ playerData: { autoScr: true } }),
"Should reject scores where autoScr is set to true."
);
assertFail(
dm({ playerData: { random: "H-RAN" } }),
"Should reject scores where random is set to H-RAN."
);
assertFail(
dm({ playerData: { random: "ALLSCR" } }),
"Should reject scores where random is set to ALLSCR"
);
assertFail({}, "Should reject an empty object");