feat(03-02): rewrite HomeScreen with daily plan UI, completion animation, empty states, and tests
- Complete HomeScreen rewrite: progress card, overdue/today/tomorrow sections - Animated task completion with SizeTransition + SlideTransition on checkbox tap - "All clear" celebration state when all tasks done, "no tasks" state for first-run - Room name tags navigate to room task list via context.go - 6 widget tests covering empty, all-clear, normal state, overdue, tomorrow sections - Fixed app_shell_test to override dailyPlanProvider for new HomeScreen dependency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,8 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:household_keeper/core/router/router.dart';
|
||||
import 'package:household_keeper/features/home/domain/daily_plan_models.dart';
|
||||
import 'package:household_keeper/features/home/presentation/daily_plan_providers.dart';
|
||||
import 'package:household_keeper/features/rooms/presentation/room_providers.dart';
|
||||
import 'package:household_keeper/l10n/app_localizations.dart';
|
||||
|
||||
@@ -13,7 +15,7 @@ void main() {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
});
|
||||
|
||||
/// Helper to build the app with room provider overridden to empty list.
|
||||
/// Helper to build the app with providers overridden for testing.
|
||||
Widget buildApp() {
|
||||
return ProviderScope(
|
||||
overrides: [
|
||||
@@ -22,6 +24,17 @@ void main() {
|
||||
roomWithStatsListProvider.overrideWith(
|
||||
(ref) => Stream.value([]),
|
||||
),
|
||||
// Override daily plan to return empty state so HomeScreen
|
||||
// renders without a database.
|
||||
dailyPlanProvider.overrideWith(
|
||||
(ref) => Stream.value(const DailyPlanState(
|
||||
overdueTasks: [],
|
||||
todayTasks: [],
|
||||
tomorrowTasks: [],
|
||||
completedTodayCount: 0,
|
||||
totalTodayCount: 0,
|
||||
)),
|
||||
),
|
||||
],
|
||||
child: MaterialApp.router(
|
||||
routerConfig: router,
|
||||
@@ -52,7 +65,8 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
// Initially on Home tab (index 0) -- verify home empty state is shown
|
||||
expect(find.text('Noch nichts zu tun!'), findsOneWidget);
|
||||
// (dailyPlanNoTasks text from the daily plan empty state)
|
||||
expect(find.text('Noch keine Aufgaben angelegt'), findsOneWidget);
|
||||
|
||||
// Tap the Rooms tab (second destination)
|
||||
await tester.tap(find.text('R\u00e4ume'));
|
||||
|
||||
Reference in New Issue
Block a user