diff --git a/tests/api.test.ts b/tests/api.test.ts index 20cfc293..cdaf906a 100644 --- a/tests/api.test.ts +++ b/tests/api.test.ts @@ -16,37 +16,6 @@ describe("API Tests", () => { await deleteUsers(); }); - describe("GET /api/v1/instance", () => { - test("should return an APIInstance object", async () => { - const response = await sendTestRequest( - new Request( - wrapRelativeUrl(`${base_url}/api/v1/instance`, base_url), - ), - ); - - expect(response.status).toBe(200); - expect(response.headers.get("content-type")).toBe( - "application/json", - ); - - const instance = (await response.json()) as APIInstance; - - expect(instance.uri).toBe(config.http.base_url); - expect(instance.title).toBeDefined(); - expect(instance.description).toBeDefined(); - expect(instance.email).toBeDefined(); - expect(instance.version).toBeDefined(); - expect(instance.urls).toBeDefined(); - expect(instance.stats).toBeDefined(); - expect(instance.thumbnail).toBeDefined(); - expect(instance.languages).toBeDefined(); - // Not implemented yet - // expect(instance.contact_account).toBeDefined(); - expect(instance.rules).toBeDefined(); - expect(instance.approval_required).toBeDefined(); - }); - }); - describe("GET /api/v1/custom_emojis", () => { beforeAll(async () => { await db.insert(emoji).values({ diff --git a/tests/api/accounts.test.ts b/tests/api/accounts.test.ts index 6e6711a6..4a6042a4 100644 --- a/tests/api/accounts.test.ts +++ b/tests/api/accounts.test.ts @@ -17,26 +17,6 @@ afterAll(async () => { }); describe("API Tests", () => { - describe("POST /api/v1/accounts/:id", () => { - test("should return a 404 error when trying to fetch a non-existent user", async () => { - const response = await sendTestRequest( - new Request( - wrapRelativeUrl("/api/v1/accounts/999999", base_url), - { - headers: { - Authorization: `Bearer ${token.accessToken}`, - }, - }, - ), - ); - - expect(response.status).toBe(404); - expect(response.headers.get("content-type")).toBe( - "application/json", - ); - }); - }); - describe("PATCH /api/v1/accounts/update_credentials", () => { test("should update the authenticated user's display name", async () => { const response = await sendTestRequest( @@ -675,43 +655,6 @@ describe("API Tests", () => { expect(Array.isArray(familiarFollowers)).toBe(true); expect(familiarFollowers.length).toBe(0); - /* expect(typeof familiarFollowers[0].id).toBe("string"); - expect(Array.isArray(familiarFollowers[0].accounts)).toBe(true); - expect(familiarFollowers[0].accounts.length).toBeGreaterThanOrEqual( - 0 - ); - - if (familiarFollowers[0].accounts.length === 0) return; - expect(familiarFollowers[0].accounts[0].id).toBeDefined(); - expect(familiarFollowers[0].accounts[0].username).toBeDefined(); - expect(familiarFollowers[0].accounts[0].acct).toBeDefined(); - expect(familiarFollowers[0].accounts[0].display_name).toBeDefined(); - expect(familiarFollowers[0].accounts[0].locked).toBeDefined(); - expect(familiarFollowers[0].accounts[0].bot).toBeDefined(); - expect(familiarFollowers[0].accounts[0].discoverable).toBeDefined(); - expect(familiarFollowers[0].accounts[0].group).toBeDefined(); - expect(familiarFollowers[0].accounts[0].created_at).toBeDefined(); - expect(familiarFollowers[0].accounts[0].note).toBeDefined(); - expect(familiarFollowers[0].accounts[0].url).toBeDefined(); - expect(familiarFollowers[0].accounts[0].avatar).toBeDefined(); - expect( - familiarFollowers[0].accounts[0].avatar_static - ).toBeDefined(); - expect(familiarFollowers[0].accounts[0].header).toBeDefined(); - expect( - familiarFollowers[0].accounts[0].header_static - ).toBeDefined(); - expect( - familiarFollowers[0].accounts[0].followers_count - ).toBeDefined(); - expect( - familiarFollowers[0].accounts[0].following_count - ).toBeDefined(); - expect( - familiarFollowers[0].accounts[0].statuses_count - ).toBeDefined(); - expect(familiarFollowers[0].accounts[0].emojis).toBeDefined(); - expect(familiarFollowers[0].accounts[0].fields).toBeDefined(); */ }); }); }); diff --git a/tests/api/statuses.test.ts b/tests/api/statuses.test.ts index 487dc4dc..8c7f1ca4 100644 --- a/tests/api/statuses.test.ts +++ b/tests/api/statuses.test.ts @@ -288,34 +288,6 @@ describe("API Tests", () => { }); }); - describe("GET /api/v1/timelines/public", () => { - test("should return an array of APIStatus objects that includes the created status", async () => { - const response = await sendTestRequest( - new Request( - wrapRelativeUrl( - `${base_url}/api/v1/timelines/public`, - base_url, - ), - { - method: "GET", - headers: { - Authorization: `Bearer ${token.accessToken}`, - }, - }, - ), - ); - - expect(response.status).toBe(200); - expect(response.headers.get("content-type")).toBe( - "application/json", - ); - - const statuses = (await response.json()) as APIStatus[]; - - expect(statuses.some((s) => s.id === status?.id)).toBe(true); - }); - }); - describe("GET /api/v1/accounts/:id/statuses", () => { test("should return the statuses of the specified user", async () => { const response = await sendTestRequest(