refactor(database): 🎨 Improve database handlers to have more consistent naming and methods

This commit is contained in:
Jesse Wierzbinski 2024-06-12 14:45:07 -10:00
parent a6159b9d55
commit 5565bf00de
No known key found for this signature in database
47 changed files with 365 additions and 333 deletions

View file

@ -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(),
);

View file

@ -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(

View file

@ -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);
};