ci: trigga på master + formatfix inför Gitea Actions
CI / Typecheck, test & build (push) Failing after 2s
CI / Typecheck, test & build (push) Failing after 2s
This commit is contained in:
@@ -13,10 +13,7 @@ describe.sequential("SEND_PROACTIVE_TIPS", () => {
|
||||
const emailBase = "proactive-tips-test";
|
||||
|
||||
async function cleanup() {
|
||||
const emails = [
|
||||
`${emailBase}-owner@example.invalid`,
|
||||
`${emailBase}-member@example.invalid`,
|
||||
];
|
||||
const emails = [`${emailBase}-owner@example.invalid`, `${emailBase}-member@example.invalid`];
|
||||
const users = await testDb.db
|
||||
.select({ id: schema.users.id })
|
||||
.from(schema.users)
|
||||
@@ -24,7 +21,9 @@ describe.sequential("SEND_PROACTIVE_TIPS", () => {
|
||||
const userIds = users.map((u) => u.id);
|
||||
for (const userId of userIds) {
|
||||
await testDb.db.delete(schema.userConsents).where(eq(schema.userConsents.userId, userId));
|
||||
await testDb.db.delete(schema.householdMembers).where(eq(schema.householdMembers.userId, userId));
|
||||
await testDb.db
|
||||
.delete(schema.householdMembers)
|
||||
.where(eq(schema.householdMembers.userId, userId));
|
||||
await testDb.db.delete(schema.notifications).where(eq(schema.notifications.userId, userId));
|
||||
}
|
||||
const households = await testDb.db
|
||||
@@ -32,20 +31,36 @@ describe.sequential("SEND_PROACTIVE_TIPS", () => {
|
||||
.from(schema.households)
|
||||
.where(eq(schema.households.name, "Proactive Tips Test"));
|
||||
for (const h of households) {
|
||||
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));
|
||||
}
|
||||
for (const email of emails) {
|
||||
await testDb.db.delete(schema.users).where(eq(schema.users.email, email));
|
||||
}
|
||||
// Clean up test recipes/ingredients if exists.
|
||||
await testDb.db.delete(schema.recipeIngredients).where(eq(schema.recipeIngredients.recipeId, "00000000-0000-0000-0000-000000000abc"));
|
||||
await testDb.db.delete(schema.recipeIngredients).where(eq(schema.recipeIngredients.recipeId, "00000000-0000-0000-0000-000000000def"));
|
||||
await testDb.db.delete(schema.recipes).where(eq(schema.recipes.id, "00000000-0000-0000-0000-000000000abc"));
|
||||
await testDb.db.delete(schema.recipes).where(eq(schema.recipes.id, "00000000-0000-0000-0000-000000000def"));
|
||||
await testDb.db.delete(schema.canonicalIngredients).where(eq(schema.canonicalIngredients.id, "test_cucumber_001"));
|
||||
await testDb.db.delete(schema.canonicalIngredients).where(eq(schema.canonicalIngredients.id, "test_tomato_001"));
|
||||
await testDb.db
|
||||
.delete(schema.recipeIngredients)
|
||||
.where(eq(schema.recipeIngredients.recipeId, "00000000-0000-0000-0000-000000000abc"));
|
||||
await testDb.db
|
||||
.delete(schema.recipeIngredients)
|
||||
.where(eq(schema.recipeIngredients.recipeId, "00000000-0000-0000-0000-000000000def"));
|
||||
await testDb.db
|
||||
.delete(schema.recipes)
|
||||
.where(eq(schema.recipes.id, "00000000-0000-0000-0000-000000000abc"));
|
||||
await testDb.db
|
||||
.delete(schema.recipes)
|
||||
.where(eq(schema.recipes.id, "00000000-0000-0000-0000-000000000def"));
|
||||
await testDb.db
|
||||
.delete(schema.canonicalIngredients)
|
||||
.where(eq(schema.canonicalIngredients.id, "test_cucumber_001"));
|
||||
await testDb.db
|
||||
.delete(schema.canonicalIngredients)
|
||||
.where(eq(schema.canonicalIngredients.id, "test_tomato_001"));
|
||||
}
|
||||
|
||||
async function setup() {
|
||||
@@ -68,7 +83,12 @@ describe.sequential("SEND_PROACTIVE_TIPS", () => {
|
||||
|
||||
const [household] = await testDb.db
|
||||
.insert(schema.households)
|
||||
.values({ name: "Proactive Tips Test", size: 2, locale: "sv-SE", inviteCode: "PROACTIVETEST" })
|
||||
.values({
|
||||
name: "Proactive Tips Test",
|
||||
size: 2,
|
||||
locale: "sv-SE",
|
||||
inviteCode: "PROACTIVETEST",
|
||||
})
|
||||
.returning();
|
||||
|
||||
await testDb.db.insert(schema.householdMembers).values([
|
||||
@@ -236,7 +256,9 @@ describe.sequential("SEND_PROACTIVE_TIPS", () => {
|
||||
await testDb.db
|
||||
.update(schema.userConsents)
|
||||
.set({ status: "revoked" })
|
||||
.where(and(eq(schema.userConsents.userId, ownerId), eq(schema.userConsents.kind, "notifications")));
|
||||
.where(
|
||||
and(eq(schema.userConsents.userId, ownerId), eq(schema.userConsents.kind, "notifications")),
|
||||
);
|
||||
|
||||
// Rensa notisen för att simulera ny dag.
|
||||
await testDb.db.delete(schema.notifications).where(eq(schema.notifications.userId, ownerId));
|
||||
|
||||
Reference in New Issue
Block a user