Refactor: Update mocks in test files for improved structure and clarity
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 7m4s

This commit is contained in:
2025-12-15 00:53:51 -08:00
parent 066933ff6d
commit 648f1c0239
10 changed files with 92 additions and 57 deletions

View File

@@ -35,18 +35,23 @@ const { mockedDb } = vi.hoisted(() => {
getAllBrands: vi.fn(),
deleteFlyer: vi.fn(),
},
recipeRepo: {
deleteRecipe: vi.fn(),
},
userRepo: {
findUserProfileById: vi.fn(),
deleteUserById: vi.fn(),
},
}
}
});
vi.mock('../services/db/index.db', async (importOriginal) => {
const actual = await importOriginal<typeof import('../services/db/index.db')>();
return {
...actual,
adminRepo: mockedDb.adminRepo,
flyerRepo: mockedDb.flyerRepo,
};
});
vi.mock('../services/db/index.db', () => ({
adminRepo: mockedDb.adminRepo,
flyerRepo: mockedDb.flyerRepo,
recipeRepo: mockedDb.recipeRepo,
userRepo: mockedDb.userRepo,
}));
// Mock other dependencies
vi.mock('../services/db/recipe.db');