mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(database): 🎨 Improve database handlers to have more consistent naming and methods
This commit is contained in:
parent
a6159b9d55
commit
5565bf00de
47 changed files with 365 additions and 333 deletions
|
|
@ -79,7 +79,7 @@ describe("API Tests", () => {
|
|||
|
||||
const account = (await response.json()) as APIAccount;
|
||||
|
||||
expect(account.username).toBe(user.getUser().username);
|
||||
expect(account.username).toBe(user.data.username);
|
||||
expect(account.bot).toBe(false);
|
||||
expect(account.locked).toBe(false);
|
||||
expect(account.created_at).toBeDefined();
|
||||
|
|
@ -89,7 +89,7 @@ describe("API Tests", () => {
|
|||
expect(account.note).toBe("");
|
||||
expect(account.url).toBe(
|
||||
new URL(
|
||||
`/@${user.getUser().username}`,
|
||||
`/@${user.data.username}`,
|
||||
config.http.base_url,
|
||||
).toString(),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ describe("POST /api/auth/login/", () => {
|
|||
test("should get a JWT", async () => {
|
||||
const formData = new FormData();
|
||||
|
||||
formData.append("identifier", users[0]?.getUser().email ?? "");
|
||||
formData.append("identifier", users[0]?.data.email ?? "");
|
||||
formData.append("password", passwords[0]);
|
||||
|
||||
const response = await sendTestRequest(
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ export const getTestStatuses = async (
|
|||
user: User,
|
||||
partial?: Partial<Status>,
|
||||
) => {
|
||||
const statuses: Status[] = [];
|
||||
const statuses: Note[] = [];
|
||||
|
||||
for (let i = 0; i < count; i++) {
|
||||
const newStatus = await Note.insert({
|
||||
|
|
@ -116,5 +116,5 @@ export const getTestStatuses = async (
|
|||
undefined,
|
||||
user.id,
|
||||
)
|
||||
).map((n) => n.getStatus());
|
||||
).map((n) => n.data);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue