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
+28 -8
View File
@@ -30,11 +30,19 @@ describe("quick reconciliation", () => {
.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.inventoryTransactions)
.where(eq(schema.inventoryTransactions.inventoryItemId, it.id));
}
await testDb.db.delete(schema.inventoryItems).where(eq(schema.inventoryItems.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.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.userPreferences).where(eq(schema.userPreferences.userId, u.id));
@@ -97,7 +105,9 @@ describe("quick reconciliation", () => {
payload: {},
});
expect(res.statusCode).toBe(200);
const body = JSON.parse(res.body) as { candidates: Array<{ itemId: string; reasons: unknown[]; suggestedAction: string }> };
const body = JSON.parse(res.body) as {
candidates: Array<{ itemId: string; reasons: unknown[]; suggestedAction: string }>;
};
expect(body.candidates.length).toBeGreaterThan(0);
expect(body.candidates[0]?.reasons.length).toBeGreaterThan(0);
});
@@ -119,7 +129,11 @@ describe("quick reconciliation", () => {
payload: { action: "exists", quantity: 0.5 },
});
expect(res.statusCode).toBe(200);
const body = JSON.parse(res.body) as { action: string; quantity: number; verifiedByUser: boolean };
const body = JSON.parse(res.body) as {
action: string;
quantity: number;
verifiedByUser: boolean;
};
expect(body.action).toBe("exists");
expect(body.quantity).toBe(0.5);
expect(body.verifiedByUser).toBe(true);
@@ -142,10 +156,16 @@ describe("quick reconciliation", () => {
.where(eq(schema.inventoryItems.id, itemId))
.limit(1);
const txs = await testDb.db
.select({ type: schema.inventoryTransactions.type, quantityDelta: schema.inventoryTransactions.quantityDelta, unit: schema.inventoryTransactions.unit })
.select({
type: schema.inventoryTransactions.type,
quantityDelta: schema.inventoryTransactions.quantityDelta,
unit: schema.inventoryTransactions.unit,
})
.from(schema.inventoryTransactions)
.where(eq(schema.inventoryTransactions.inventoryItemId, itemId));
const balance = computeBalance(txs.map((tx) => ({ type: tx.type, quantityDelta: tx.quantityDelta, unit: tx.unit })));
const balance = computeBalance(
txs.map((tx) => ({ type: tx.type, quantityDelta: tx.quantityDelta, unit: tx.unit })),
);
expect(balance.balance).toBeCloseTo(item!.quantity, 5);
}