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
+29 -9
View File
@@ -33,13 +33,25 @@ describe("scan confirmation → ai_corrections", () => {
.from(schema.inventoryItems)
.where(eq(schema.inventoryItems.householdId, m.householdId));
for (const it of items) {
await testDb.db.delete(schema.inventoryTransactions).where(eq(schema.inventoryTransactions.inventoryItemId, it.id));
await testDb.db.delete(schema.inventoryConflicts).where(eq(schema.inventoryConflicts.inventoryItemId, it.id));
await testDb.db
.delete(schema.inventoryTransactions)
.where(eq(schema.inventoryTransactions.inventoryItemId, it.id));
await testDb.db
.delete(schema.inventoryConflicts)
.where(eq(schema.inventoryConflicts.inventoryItemId, it.id));
}
await testDb.db.delete(schema.inventoryItems).where(eq(schema.inventoryItems.householdId, m.householdId));
await testDb.db.delete(schema.inventoryConflicts).where(eq(schema.inventoryConflicts.householdId, m.householdId));
await testDb.db.delete(schema.storageLocations).where(eq(schema.storageLocations.householdId, m.householdId));
await testDb.db.delete(schema.householdMembers).where(eq(schema.householdMembers.householdId, m.householdId));
await testDb.db
.delete(schema.inventoryItems)
.where(eq(schema.inventoryItems.householdId, m.householdId));
await testDb.db
.delete(schema.inventoryConflicts)
.where(eq(schema.inventoryConflicts.householdId, m.householdId));
await testDb.db
.delete(schema.storageLocations)
.where(eq(schema.storageLocations.householdId, m.householdId));
await testDb.db
.delete(schema.householdMembers)
.where(eq(schema.householdMembers.householdId, m.householdId));
await testDb.db.delete(schema.households).where(eq(schema.households.id, m.householdId));
}
await testDb.db.delete(schema.scanJobs).where(eq(schema.scanJobs.userId, u.id));
@@ -62,7 +74,11 @@ describe("scan confirmation → ai_corrections", () => {
}
await testDb.db
.insert(schema.userConsents)
.values({ userId, kind: "image_training" as const, status: (imageTraining ? "granted" : "denied") as "granted" | "denied" })
.values({
userId,
kind: "image_training" as const,
status: (imageTraining ? "granted" : "denied") as "granted" | "denied",
})
.onConflictDoUpdate({
target: [schema.userConsents.userId, schema.userConsents.kind],
set: { status: (imageTraining ? "granted" : "denied") as "granted" | "denied" },
@@ -168,7 +184,9 @@ describe("scan confirmation → ai_corrections", () => {
expect(corrections).toHaveLength(1);
expect((corrections[0]!.userCorrection as Record<string, string>).action).toBe("accept");
expect((corrections[0]!.proposal as Record<string, unknown>).detectedName).toBe("Mellanmjölk");
expect((corrections[0]!.userCorrection as Record<string, Record<string, unknown>>).corrected).toMatchObject({
expect(
(corrections[0]!.userCorrection as Record<string, Record<string, unknown>>).corrected,
).toMatchObject({
displayName: "Mellanmjölk",
quantity: 1,
unit: "LITER",
@@ -203,7 +221,9 @@ describe("scan confirmation → ai_corrections", () => {
.from(schema.aiCorrections)
.where(eq(schema.aiCorrections.scanJobId, scanJobId));
expect(corrections[0]!.imageS3Key).toBe("fridge-scans/test-image.jpg");
expect((corrections[0]!.consentSnapshot as Record<string, string>).image_training).toBe("granted");
expect((corrections[0]!.consentSnapshot as Record<string, string>).image_training).toBe(
"granted",
);
});
it("does not save image reference when image_training consent is denied", async () => {