test: added test cases for .addReport and .rescindReport()

This commit is contained in:
Julian Lam
2023-10-11 11:23:55 -04:00
parent bc0f362cd7
commit da2390594a
2 changed files with 78 additions and 0 deletions

View File

@@ -545,6 +545,7 @@ Flags.getReports = async function (flagId) {
return reports;
};
// Not meant to be called directly, call Flags.create() instead.
Flags.addReport = async function (flagId, type, id, uid, reason, timestamp) {
await db.sortedSetAddBulk([
[`flags:byReporter:${uid}`, timestamp, flagId],