Refactors, bugfixing

This commit is contained in:
Jesse Wierzbinski 2024-04-07 17:28:18 -10:00
parent 5812618170
commit e26d604a54
No known key found for this signature in database
42 changed files with 370 additions and 376 deletions

View file

@ -172,7 +172,7 @@ describe("API Tests", () => {
expect(account.statuses_count).toBe(0);
expect(account.note).toBe("");
expect(account.url).toBe(
`${config.http.base_url}/users/${user.id}`,
new URL(`/users/${user.id}`, config.http.base_url).toString(),
);
expect(account.avatar).toBeDefined();
expect(account.avatar_static).toBeDefined();

View file

@ -136,7 +136,6 @@ describe("API Tests", () => {
"application/json",
);
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
status = (await response.json()) as APIStatus;
expect(status.content).toContain("Hello, world!");
expect(status.visibility).toBe("public");
@ -184,7 +183,6 @@ describe("API Tests", () => {
"application/json",
);
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
status2 = (await response.json()) as APIStatus;
expect(status2.content).toContain("This is a reply!");
expect(status2.visibility).toBe("public");

View file

@ -40,7 +40,6 @@ describe("POST /api/v1/apps/", () => {
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe("application/json");
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const json = await response.json();
expect(json).toEqual({
@ -53,9 +52,7 @@ describe("POST /api/v1/apps/", () => {
vapid_link: null,
});
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
client_id = json.client_id;
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
client_secret = json.client_secret;
});
});
@ -111,7 +108,6 @@ describe("POST /oauth/token/", () => {
}),
);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const json = await response.json();
expect(response.status).toBe(200);
@ -123,7 +119,6 @@ describe("POST /oauth/token/", () => {
created_at: expect.any(Number),
});
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
token = json;
});
});