moar unit test !
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 5m46s
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 5m46s
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// src/tests/utils/mockFactories.ts
|
||||
import { UserProfile, User, Flyer, Store, SuggestedCorrection, Brand, FlyerItem, MasterGroceryItem, ShoppingList, ShoppingListItem, Achievement, UserAchievement, Budget, SpendingByCategory, Recipe, RecipeComment, ActivityLogItem } from '../../types';
|
||||
import { UserProfile, User, Flyer, Store, SuggestedCorrection, Brand, FlyerItem, MasterGroceryItem, ShoppingList, ShoppingListItem, Achievement, UserAchievement, Budget, SpendingByCategory, Recipe, RecipeComment, ActivityLogItem, DietaryRestriction, Appliance } from '../../types';
|
||||
|
||||
/**
|
||||
* Creates a mock UserProfile object for use in tests, ensuring type safety.
|
||||
@@ -358,4 +358,26 @@ export const createMockShoppingListItem = (overrides: Partial<ShoppingListItem>
|
||||
};
|
||||
|
||||
return { ...defaultItem, ...overrides };
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a mock DietaryRestriction object for testing.
|
||||
* @param overrides - Optional properties to override the defaults.
|
||||
* @returns A mock DietaryRestriction object.
|
||||
*/
|
||||
export const createMockDietaryRestriction = (overrides: Partial<DietaryRestriction> = {}): DietaryRestriction => {
|
||||
return {
|
||||
dietary_restriction_id: 1,
|
||||
name: 'Vegetarian',
|
||||
type: 'diet',
|
||||
...overrides,
|
||||
};
|
||||
};
|
||||
|
||||
export const createMockAppliance = (overrides: Partial<Appliance> = {}): Appliance => {
|
||||
return {
|
||||
appliance_id: 1,
|
||||
name: 'Oven',
|
||||
...overrides,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user