fixes before build 3
This commit is contained in:
@@ -71,6 +71,25 @@ void main() {
|
||||
]);
|
||||
});
|
||||
|
||||
test('wipeAllData clears products, trips, lists, and settings', () async {
|
||||
final repository = memoryRepository();
|
||||
await repository.saveShop(
|
||||
supermarket: 'Jumbo',
|
||||
shoppedAt: DateTime(2026, 8, 12),
|
||||
items: [LineItem(id: '1', name: 'Milk', price: 1.5)],
|
||||
);
|
||||
await repository.createShoppingList('Weekly');
|
||||
await repository.setDarkMode(true);
|
||||
|
||||
await repository.wipeAllData();
|
||||
|
||||
expect(await repository.getAll(), isEmpty);
|
||||
expect(await repository.getShops(), isEmpty);
|
||||
expect(await repository.getShoppingLists(), isEmpty);
|
||||
expect(await repository.getDarkMode(), isFalse);
|
||||
expect((await repository.getSupermarkets()).length, greaterThan(0));
|
||||
});
|
||||
|
||||
test('deleting all products leaves shopping trips in place', () async {
|
||||
final repository = memoryRepository();
|
||||
await repository.saveShop(
|
||||
|
||||
Reference in New Issue
Block a user