mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
More Lysand protocol work, refactor keys, small refactoring overall
This commit is contained in:
parent
77a675afe6
commit
a1c0164e9d
11 changed files with 304 additions and 89 deletions
|
|
@ -109,7 +109,8 @@ describe("API Tests", () => {
|
|||
const emoji = new Emoji();
|
||||
|
||||
emoji.instance = null;
|
||||
emoji.url = "https://example.com";
|
||||
emoji.url = "https://example.com/test.png";
|
||||
emoji.content_type = "image/png";
|
||||
emoji.shortcode = "test";
|
||||
emoji.visible_in_picker = true;
|
||||
|
||||
|
|
@ -135,7 +136,7 @@ describe("API Tests", () => {
|
|||
|
||||
expect(emojis.length).toBeGreaterThan(0);
|
||||
expect(emojis[0].shortcode).toBe("test");
|
||||
expect(emojis[0].url).toBe("https://example.com");
|
||||
expect(emojis[0].url).toBe("https://example.com/test.png");
|
||||
});
|
||||
afterAll(async () => {
|
||||
await Emoji.delete({ shortcode: "test" });
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ describe("API Tests", () => {
|
|||
const status1 = statuses[1];
|
||||
|
||||
// Basic validation
|
||||
expect(status1.content).toBe("Hello, world!");
|
||||
expect(status1.content).toBe("This is a reply!");
|
||||
expect(status1.visibility).toBe("public");
|
||||
expect(status1.account.id).toBe(user.id);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { afterAll, beforeAll, describe, expect, it } from "bun:test";
|
||||
/* import { afterAll, beforeAll, describe, expect, it } from "bun:test";
|
||||
import { AppDataSource } from "~database/datasource";
|
||||
import { Instance } from "~database/entities/Instance";
|
||||
|
||||
|
|
@ -14,25 +14,6 @@ describe("Instance", () => {
|
|||
instance = await Instance.addIfNotExists(url);
|
||||
expect(instance.base_url).toBe("mastodon.social");
|
||||
});
|
||||
|
||||
it("should convert the instance to an API instance", async () => {
|
||||
const apiInstance = await instance.toAPI();
|
||||
expect(apiInstance.uri).toBe("mastodon.social");
|
||||
expect(apiInstance.approval_required).toBe(false);
|
||||
expect(apiInstance.email).toBe("staff@mastodon.social");
|
||||
expect(apiInstance.thumbnail).toBeDefined();
|
||||
expect(apiInstance.title).toBeDefined();
|
||||
expect(apiInstance.configuration).toBeDefined();
|
||||
expect(apiInstance.contact_account).toBeDefined();
|
||||
expect(apiInstance.description).toBeDefined();
|
||||
expect(apiInstance.invites_enabled).toBeDefined();
|
||||
expect(apiInstance.languages).toBeDefined();
|
||||
expect(apiInstance.registrations).toBeDefined();
|
||||
expect(apiInstance.rules).toBeDefined();
|
||||
expect(apiInstance.stats).toBeDefined();
|
||||
expect(apiInstance.urls).toBeDefined();
|
||||
expect(apiInstance.max_toot_chars).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
|
|
@ -40,3 +21,4 @@ afterAll(async () => {
|
|||
|
||||
await AppDataSource.destroy();
|
||||
});
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue