Always flush foldercache in tests

This commit is contained in:
zkldi
2022-04-13 23:33:53 +01:00
parent 7d47feb1e3
commit bc8bb2eecc
8 changed files with 11 additions and 11 deletions
@@ -65,8 +65,8 @@ t.test("#GetRelevantFolderGoals", (t) => {
await db.folders.insert(sp11folder);
await db.goals.insert(fakeFolderGoalDocument);
await db.goals.insert(notFolderGoalDocument);
await CreateFolderChartLookup(TestingIIDXFolderSP10);
await CreateFolderChartLookup(sp11folder);
await CreateFolderChartLookup(TestingIIDXFolderSP10, true);
await CreateFolderChartLookup(sp11folder, true);
});
t.test("Should correctly find the goals on this folder.", async (t) => {
+1 -1
View File
@@ -13,7 +13,7 @@ import { IIDX_LAMPS } from "tachi-common";
t.test("#EvaluateShowcaseStat", (t) => {
t.beforeEach(ResetDBState);
t.beforeEach(async () => await CreateFolderChartLookup(TestingIIDXFolderSP10));
t.beforeEach(async () => await CreateFolderChartLookup(TestingIIDXFolderSP10, true));
t.beforeEach(
async () => await db["personal-bests"].insert(deepmerge(TestingIIDXSPScorePB, {}))
);
+1 -1
View File
@@ -14,7 +14,7 @@ t.test("#EvalulateUsersStatsShowcase", (t) => {
t.beforeEach(async () => {
await db.folders.insert(TestingIIDXFolderSP10);
await CreateFolderChartLookup(TestingIIDXFolderSP10);
await CreateFolderChartLookup(TestingIIDXFolderSP10, true);
await db["game-settings"].remove({});
+1 -1
View File
@@ -226,7 +226,7 @@ t.test("#EvaluateGoalForUser", (t) => {
}),
]);
await CreateFolderChartLookup(TestingIIDXFolderSP10);
await CreateFolderChartLookup(TestingIIDXFolderSP10, true);
});
t.test("Should work if 511 is >= HARD CLEAR", async (t) => {
@@ -54,7 +54,7 @@ t.test("GET /api/v1/games/:game/:playtype/folders/:folderID", (t) => {
t.test("Should return the folder at this ID.", async (t) => {
await db.folders.insert(deepmerge(mockFolder, {}));
await CreateFolderChartLookup(mockFolder);
await CreateFolderChartLookup(mockFolder, true);
const res = await mockApi.get("/api/v1/games/iidx/SP/folders/foo");
@@ -20,7 +20,7 @@ t.test("GET /api/v1/users/:userID/games/:game/:playtype/folders/:folderID", (t)
folderID: "testing_folder",
}) as FolderDocument;
await db.folders.insert(folder);
await CreateFolderChartLookup(folder);
await CreateFolderChartLookup(folder, true);
await db["personal-bests"].insert(deepmerge(TestingIIDXSPScorePB, {}));
});
@@ -56,7 +56,7 @@ t.test("GET /api/v1/users/:userID/games/:game/:playtype/folders/:folderID/timeli
t.beforeEach(ResetDBState);
t.beforeEach(async () => {
await db.folders.insert(folder);
await CreateFolderChartLookup(folder);
await CreateFolderChartLookup(folder, true);
await db["personal-bests"].insert(deepmerge(TestingIIDXSPScorePB, {}));
});
@@ -68,7 +68,7 @@ t.test("GET /api/v1/users/:userID/games/:game/:playtype/folders/:folderID/timeli
await db.songs.iidx.insert(GetKTDataJSON("./tachi/tachi-songs-iidx.json"));
await db.charts.iidx.insert(GetKTDataJSON("./tachi/tachi-charts-iidx.json"));
await CreateFolderChartLookup(folder);
await CreateFolderChartLookup(folder, true);
await db.scores.insert([
deepmerge(TestingIIDXSPScore, {
@@ -9,7 +9,7 @@ import { CreateFolderChartLookup } from "utils/folder";
const SetFolders = async () => {
await db.folders.insert(TestingIIDXFolderSP10);
await CreateFolderChartLookup(TestingIIDXFolderSP10);
await CreateFolderChartLookup(TestingIIDXFolderSP10, true);
await db["game-settings"].remove({});
@@ -16,7 +16,7 @@ t.test("GET /api/v1/users/:userID/games/:game/:playtype/tables/:tableID", (t) =>
}) as FolderDocument;
await db.folders.insert(folder);
await CreateFolderChartLookup(folder);
await CreateFolderChartLookup(folder, true);
await db["personal-bests"].insert(TestingIIDXSPScorePB);