mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-02 20:08:17 +03:00
Merge branch 'hotfix/v2.0.15'
This commit is contained in:
@@ -72,21 +72,20 @@ t.test("GET /ir/usc/Keyboard", async (t) => {
|
||||
|
||||
t.test("GET /ir/usc/Controller", async (t) => {
|
||||
t.beforeEach(ResetDBState);
|
||||
t.beforeEach(async () => {
|
||||
await db["api-tokens"].insert({
|
||||
userID: 1,
|
||||
identifier: "USC Token",
|
||||
permissions: {
|
||||
submit_score: true,
|
||||
},
|
||||
token: "foo",
|
||||
fromAPIClient: null,
|
||||
});
|
||||
|
||||
await db["api-tokens"].insert({
|
||||
userID: 1,
|
||||
identifier: "USC Token",
|
||||
permissions: {
|
||||
submit_score: true,
|
||||
},
|
||||
token: "fee",
|
||||
fromAPIClient: null,
|
||||
});
|
||||
|
||||
TestAuth("/ir/usc/Controller");
|
||||
|
||||
const res = await mockApi.get("/ir/usc/Controller").set("Authorization", "Bearer foo");
|
||||
const res = await mockApi.get("/ir/usc/Controller").set("Authorization", "Bearer fee");
|
||||
|
||||
t.equal(res.body.statusCode, 20, "Should return 20");
|
||||
t.match(
|
||||
@@ -416,7 +415,7 @@ t.test("POST /replays", (t) => {
|
||||
t.strictSame(res.body, {
|
||||
statusCode: 20,
|
||||
description: "Saved replay.",
|
||||
body: null,
|
||||
body: {},
|
||||
});
|
||||
|
||||
const stored = await CDNRetrieve("/uscir/replays/MOCK_IDENTIFIER");
|
||||
|
||||
@@ -149,6 +149,7 @@ router.get("/charts/:chartHash", RetrieveChart, (req, res) => {
|
||||
return res.status(200).json({
|
||||
statusCode: STATUS_CODES.SUCCESS,
|
||||
description: "This chart is tracked by the IR.",
|
||||
body: {},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -414,6 +415,7 @@ router.post("/scores", RequirePermissions("submit_score"), async (req, res) => {
|
||||
return res.status(200).json({
|
||||
statusCode: STATUS_CODES.ACCEPTED,
|
||||
description: `This score has been accepted, but is waiting for more players before its parent chart is accepted. (${players.length}/${ServerConfig.USC_QUEUE_SIZE})`,
|
||||
body: {},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -508,7 +510,7 @@ router.post(
|
||||
return res.status(200).json({
|
||||
statusCode: STATUS_CODES.SUCCESS,
|
||||
description: "Saved replay.",
|
||||
body: null,
|
||||
body: {},
|
||||
});
|
||||
} catch (err) {
|
||||
// impossible to test pretty much.
|
||||
|
||||
Reference in New Issue
Block a user