mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-28 09:58:11 +03:00
Fix broken tests
This commit is contained in:
@@ -122,7 +122,7 @@ t.test("#ReprocessOrphan", (t) => {
|
||||
t.test("Should convert and insert an orphan if parents are found", async (t) => {
|
||||
// this orphan doc is for 5.1.1. SPA, which definitely exists in
|
||||
// the test DB.
|
||||
const res = await ReprocessOrphan(orphanDoc, logger);
|
||||
const res = await ReprocessOrphan(orphanDoc, [], logger);
|
||||
|
||||
t.hasStrict(
|
||||
res,
|
||||
@@ -171,6 +171,7 @@ t.test("#ReprocessOrphan", (t) => {
|
||||
score: 99999,
|
||||
},
|
||||
}),
|
||||
[],
|
||||
logger
|
||||
);
|
||||
|
||||
@@ -193,6 +194,7 @@ t.test("#ReprocessOrphan", (t) => {
|
||||
identifier: "NONSENSE CHART TITLE",
|
||||
},
|
||||
}),
|
||||
[],
|
||||
logger
|
||||
);
|
||||
|
||||
@@ -227,6 +229,7 @@ t.test("#ReprocessOrphan", (t) => {
|
||||
identifier: GAZER_SHA256,
|
||||
},
|
||||
}),
|
||||
[],
|
||||
logger
|
||||
);
|
||||
|
||||
|
||||
@@ -66,21 +66,28 @@ t.test("POST /api/v1/admin/change-log-level", async (t) => {
|
||||
t.test("POST /api/v1/admin/delete-score", async (t) => {
|
||||
t.beforeEach(ResetDBState);
|
||||
|
||||
const auth = await CreateFakeAuthCookie(mockApi);
|
||||
|
||||
await db.scores.insert(
|
||||
deepmerge<ScoreDocument>(TestingIIDXSPScore, {
|
||||
scoreID: "deleteme",
|
||||
})
|
||||
);
|
||||
|
||||
const res = await mockApi.post("/api/v1/admin/delete-score").send({
|
||||
scoreID: "deleteme",
|
||||
});
|
||||
const res = await mockApi
|
||||
.post("/api/v1/admin/delete-score")
|
||||
.set({
|
||||
Cookie: auth,
|
||||
})
|
||||
.send({
|
||||
scoreID: "deleteme",
|
||||
});
|
||||
|
||||
t.equal(res.statusCode, 200);
|
||||
|
||||
const dbScore = await db.scores.findOne({ scoreID: "deleteme" });
|
||||
|
||||
t.equal(dbScore, null, "Should remove teh score from the database.");
|
||||
t.equal(dbScore, null, "Should remove the score from the database.");
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user