mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-09 07:09:57 +03:00
songs-iidx fixture
This commit is contained in:
@@ -1,13 +1,25 @@
|
||||
import t from "tap";
|
||||
import mockApi from "../../test-utils/mock-api";
|
||||
import { TestingIIDXEamusementCSV26, TestingIIDXEamusementCSV27 } from "../../test-utils/test-data";
|
||||
import {
|
||||
GetKTDataJSON,
|
||||
TestingIIDXEamusementCSV26,
|
||||
TestingIIDXEamusementCSV27,
|
||||
} from "../../test-utils/test-data";
|
||||
import { CloseAllConnections } from "../../test-utils/close-connections";
|
||||
import { RequireNeutralAuthentication } from "../../test-utils/api-common";
|
||||
import { CreateFakeAuthCookie } from "../../test-utils/fake-session";
|
||||
import ResetDBState from "../../test-utils/reset-db-state";
|
||||
import { rootLogger } from "../../logger";
|
||||
import dump from "why-is-node-running";
|
||||
import { GetUnsuccessfulScores } from "../../test-utils/score-import-utils";
|
||||
import db from "../../db/db";
|
||||
|
||||
async function LoadKTBlackSongsIIDX() {
|
||||
let data = GetKTDataJSON("./kamaitachi/ktblack-songs-iidx.json");
|
||||
|
||||
await db.songs.iidx.remove({});
|
||||
await db.songs.iidx.insert(data);
|
||||
}
|
||||
// reset DB handles the post-stuff
|
||||
|
||||
t.test("POST /internal-api/import/file", async (t) => {
|
||||
const cookie = await CreateFakeAuthCookie(mockApi);
|
||||
@@ -17,6 +29,7 @@ t.test("POST /internal-api/import/file", async (t) => {
|
||||
RequireNeutralAuthentication("/internal-api/import/file", "POST");
|
||||
|
||||
t.test("csv:eamusement-iidx", (t) => {
|
||||
t.beforeEach(LoadKTBlackSongsIIDX);
|
||||
t.test("Valid Rootage CSV import", async (t) => {
|
||||
let res = await mockApi
|
||||
.post("/internal-api/import/file")
|
||||
|
||||
Reference in New Issue
Block a user