ci: trigga på master + formatfix inför Gitea Actions
CI / Typecheck, test & build (push) Failing after 2s

This commit is contained in:
Sven (AAMOS AI)
2026-08-13 17:25:14 +07:00
parent 61d60931ad
commit c32a7e33c7
141 changed files with 40555 additions and 45210 deletions
+22 -6
View File
@@ -19,18 +19,29 @@ describe("admin household trust score", () => {
.from(schema.users)
.where(inArray(schema.users.email, [adminEmail]));
for (const u of existing) {
await testDb.db.delete(schema.inventoryTransactions).where(eq(schema.inventoryTransactions.actorUserId, u.id));
await testDb.db
.delete(schema.inventoryTransactions)
.where(eq(schema.inventoryTransactions.actorUserId, u.id));
const owned = await testDb.db
.select({ id: schema.households.id })
.from(schema.households)
.innerJoin(schema.householdMembers, eq(schema.householdMembers.householdId, schema.households.id))
.innerJoin(
schema.householdMembers,
eq(schema.householdMembers.householdId, schema.households.id),
)
.where(eq(schema.householdMembers.userId, u.id));
for (const h of owned) {
await testDb.db.delete(schema.inventoryItems).where(eq(schema.inventoryItems.householdId, h.id));
await testDb.db.delete(schema.storageLocations).where(eq(schema.storageLocations.householdId, h.id));
await testDb.db
.delete(schema.inventoryItems)
.where(eq(schema.inventoryItems.householdId, h.id));
await testDb.db
.delete(schema.storageLocations)
.where(eq(schema.storageLocations.householdId, h.id));
await testDb.db.delete(schema.households).where(eq(schema.households.id, h.id));
}
await testDb.db.delete(schema.householdMembers).where(eq(schema.householdMembers.userId, u.id));
await testDb.db
.delete(schema.householdMembers)
.where(eq(schema.householdMembers.userId, u.id));
await testDb.db.delete(schema.userPreferences).where(eq(schema.userPreferences.userId, u.id));
await testDb.db.delete(schema.users).where(eq(schema.users.id, u.id));
}
@@ -74,7 +85,12 @@ describe("admin household trust score", () => {
headers: { authorization: `Bearer ${adminToken}` },
});
expect(res.statusCode).toBe(200);
const body = JSON.parse(res.body) as { householdId: string; score: number; status: string; itemCount: number };
const body = JSON.parse(res.body) as {
householdId: string;
score: number;
status: string;
itemCount: number;
};
expect(body.householdId).toBe(householdId);
expect(typeof body.score).toBe("number");
expect(["up_to_date", "needs_check", "uncertain"]).toContain(body.status);