fixes before build 2

This commit is contained in:
gitea
2026-08-31 17:05:22 +02:00
parent 14fcb9a533
commit b0708101b0
20 changed files with 72 additions and 61 deletions
+4 -3
View File
@@ -1,5 +1,5 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:receipity/services/backup_format.dart';
import 'package:groci/services/backup_format.dart';
void main() {
test('round-trips a backup document', () {
@@ -81,9 +81,10 @@ void main() {
expect(parsed.shoppingLists.single['name'], 'Weekly');
expect(parsed.shoppingListItems.single['name'], 'Milk');
expect(parsed.images['products/product_1.jpg'], 'abc123');
expect(parsed.encode(), contains('"format": "groci-backup"'));
});
test('accepts a version 1 backup without shopping lists', () {
test('accepts legacy receipity backup format', () {
const json = '''
{
"format": "receipity-backup",
@@ -104,7 +105,7 @@ void main() {
expect(parsed.shopTags, isEmpty);
});
test('rejects a file that is not a Receipity backup', () {
test('rejects a file that is not a Groci backup', () {
expect(
() => BackupDocument.parse('{"hello":"world"}'),
throwsFormatException,
+1 -1
View File
@@ -1,5 +1,5 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:receipity/models/line_item.dart';
import 'package:groci/models/line_item.dart';
import 'test_helpers.dart';
+1 -1
View File
@@ -1,5 +1,5 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:receipity/utils/fuzzy.dart';
import 'package:groci/utils/fuzzy.dart';
void main() {
test('matches substrings and character subsequences', () {
+3 -3
View File
@@ -1,7 +1,7 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:receipity/models/line_item.dart';
import 'package:receipity/models/product.dart';
import 'package:receipity/utils/product_names.dart';
import 'package:groci/models/line_item.dart';
import 'package:groci/models/product.dart';
import 'package:groci/utils/product_names.dart';
import 'test_helpers.dart';
+1 -1
View File
@@ -1,5 +1,5 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:receipity/services/receipt_parser.dart';
import 'package:groci/services/receipt_parser.dart';
void main() {
test('parses name and price at the end of a line', () {
+3 -3
View File
@@ -1,7 +1,7 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:receipity/models/shop.dart';
import 'package:receipity/utils/shop_calendar.dart';
import 'package:receipity/utils/shop_log_filter.dart';
import 'package:groci/models/shop.dart';
import 'package:groci/utils/shop_calendar.dart';
import 'package:groci/utils/shop_log_filter.dart';
Shop _shop({
required int id,
+2 -2
View File
@@ -1,6 +1,6 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:receipity/models/supermarket.dart';
import 'package:receipity/utils/supermarkets.dart';
import 'package:groci/models/supermarket.dart';
import 'package:groci/utils/supermarkets.dart';
void main() {
test('detects Jumbo and Lidl from receipt text', () {
+2 -2
View File
@@ -3,7 +3,7 @@ import 'dart:math';
import 'package:flutter_test/flutter_test.dart';
import 'package:path/path.dart' as p;
import 'package:receipity/services/product_repository.dart';
import 'package:groci/services/product_repository.dart';
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
var _dbSeq = 0;
@@ -18,7 +18,7 @@ void ensureTestSqlite() {
ProductRepository memoryRepository() {
ensureTestSqlite();
final dir = Directory(p.join('.dart_tool', 'receipity_test_db'))
final dir = Directory(p.join('.dart_tool', 'groci_test_db'))
..createSync(recursive: true);
final name =
'db_${DateTime.now().microsecondsSinceEpoch}_${_dbSeq++}_${Random().nextInt(1 << 32)}.sqlite';
+17 -17
View File
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:receipity/main.dart';
import 'package:receipity/models/line_item.dart';
import 'package:receipity/review_screen.dart';
import 'package:receipity/widgets/shop_heatmap.dart';
import 'package:groci/main.dart';
import 'package:groci/models/line_item.dart';
import 'package:groci/review_screen.dart';
import 'package:groci/widgets/shop_heatmap.dart';
import 'test_helpers.dart';
@@ -13,7 +13,7 @@ void main() {
testWidgets('home screen shows overview and bottom navigation', (
tester,
) async {
await tester.pumpWidget(ReceipityApp(repository: memoryRepository()));
await tester.pumpWidget(GrociApp(repository: memoryRepository()));
await pumpUntilFound(tester, find.text('Nothing logged yet.'));
expect(find.text('Home'), findsWidgets);
@@ -27,12 +27,12 @@ void main() {
});
testWidgets('scan screen shows capture actions', (tester) async {
await tester.pumpWidget(ReceipityApp(repository: memoryRepository()));
await tester.pumpWidget(GrociApp(repository: memoryRepository()));
await pumpUntilFound(tester, find.text('Overview'));
await tester.tap(find.byTooltip('Add'));
await tester.pump();
expect(find.text('Receipity'), findsOneWidget);
expect(find.text('Groci'), findsOneWidget);
expect(find.text('Take photo'), findsOneWidget);
expect(find.text('Pick from gallery'), findsOneWidget);
expect(find.text('Enter manually'), findsOneWidget);
@@ -44,7 +44,7 @@ void main() {
});
testWidgets('empty shop log hides edit and disables search', (tester) async {
await tester.pumpWidget(ReceipityApp(repository: memoryRepository()));
await tester.pumpWidget(GrociApp(repository: memoryRepository()));
await pumpUntilFound(tester, find.text('Overview'));
await tester.tap(find.text('Shop log'));
await pumpUntilFound(
@@ -80,7 +80,7 @@ void main() {
);
});
await tester.pumpWidget(ReceipityApp(repository: repository));
await tester.pumpWidget(GrociApp(repository: repository));
await pumpUntilFound(tester, find.text('Overview'));
await tester.tap(find.text('Shop log'));
await pumpUntilFound(tester, find.text('Weekly shop'));
@@ -116,7 +116,7 @@ void main() {
);
});
await tester.pumpWidget(ReceipityApp(repository: repository));
await tester.pumpWidget(GrociApp(repository: repository));
await pumpUntilFound(tester, find.text('Overview'));
await tester.tap(find.text('Products').last);
await pumpUntilFound(tester, find.text('Milk'));
@@ -142,7 +142,7 @@ void main() {
});
testWidgets('profile screen is a placeholder', (tester) async {
await tester.pumpWidget(ReceipityApp(repository: memoryRepository()));
await tester.pumpWidget(GrociApp(repository: memoryRepository()));
await pumpUntilFound(tester, find.text('Overview'));
await tester.tap(find.byTooltip('Profile'));
await pumpUntilFound(tester, find.text('Guest'));
@@ -172,7 +172,7 @@ void main() {
});
testWidgets('enter manually opens a blank trip', (tester) async {
await tester.pumpWidget(ReceipityApp(repository: memoryRepository()));
await tester.pumpWidget(GrociApp(repository: memoryRepository()));
await pumpUntilFound(tester, find.text('Overview'));
await tester.tap(find.byTooltip('Add'));
await tester.pump();
@@ -182,7 +182,7 @@ void main() {
});
testWidgets('lists tab shows shopping lists', (tester) async {
await tester.pumpWidget(ReceipityApp(repository: memoryRepository()));
await tester.pumpWidget(GrociApp(repository: memoryRepository()));
await pumpUntilFound(tester, find.text('Overview'));
await tester.tap(find.text('Lists'));
await tester.pump();
@@ -264,7 +264,7 @@ void main() {
);
});
await tester.pumpWidget(ReceipityApp(repository: repository));
await tester.pumpWidget(GrociApp(repository: repository));
await pumpUntilFound(tester, find.text('Overview'));
await tester.tap(find.text('Products').last);
await pumpUntilFound(tester, find.text('Milk'));
@@ -286,7 +286,7 @@ void main() {
final repository = memoryRepository();
await tester.runAsync(() => seedCaseConflictCatalog(repository));
await tester.pumpWidget(ReceipityApp(repository: repository));
await tester.pumpWidget(GrociApp(repository: repository));
await pumpUntilFound(tester, find.text('Overview'));
await tester.tap(find.text('Products').last);
await pumpUntilFound(tester, find.text('1 duplicate product'));
@@ -313,7 +313,7 @@ void main() {
);
});
await tester.pumpWidget(ReceipityApp(repository: repository));
await tester.pumpWidget(GrociApp(repository: repository));
await pumpUntilFound(tester, find.text('Overview'));
await tester.tap(find.text('Products').last);
await pumpUntilFound(tester, find.text('1 product, multiple spellings'));
@@ -328,7 +328,7 @@ void main() {
final repository = memoryRepository();
await tester.runAsync(() => seedCaseConflictCatalog(repository));
await tester.pumpWidget(ReceipityApp(repository: repository));
await tester.pumpWidget(GrociApp(repository: repository));
await pumpUntilFound(tester, find.text('Overview'));
await tester.tap(find.text('Products').last);
await pumpUntilFound(tester, find.text('1 duplicate product'));