test(TaskListScreen): add integration tests for filtered and overdue task states
All checks were successful
Build and Release to F-Droid / build-and-deploy (push) Successful in 10m30s
All checks were successful
Build and Release to F-Droid / build-and-deploy (push) Successful in 10m30s
- Covers empty states, celebration state, and scheduled/overdue task rendering - Verifies proper checkbox behavior for future tasks - Tests AppBar for sort dropdown, edit/delete actions, and calendar strip - Adds necessary test helpers and overrides for room-specific tasks
This commit is contained in:
@@ -20,6 +20,8 @@ class CalendarTaskRow extends StatelessWidget {
|
||||
required this.taskWithRoom,
|
||||
required this.onCompleted,
|
||||
this.isOverdue = false,
|
||||
this.showRoomTag = true,
|
||||
this.canComplete = true,
|
||||
});
|
||||
|
||||
final TaskWithRoom taskWithRoom;
|
||||
@@ -30,6 +32,12 @@ class CalendarTaskRow extends StatelessWidget {
|
||||
/// When true, task name is rendered in coral color.
|
||||
final bool isOverdue;
|
||||
|
||||
/// When false, the room tag subtitle is hidden (e.g. in room-scoped view).
|
||||
final bool showRoomTag;
|
||||
|
||||
/// When false, the checkbox is disabled (e.g. for future tasks).
|
||||
final bool canComplete;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
@@ -41,7 +49,7 @@ class CalendarTaskRow extends StatelessWidget {
|
||||
),
|
||||
leading: Checkbox(
|
||||
value: false,
|
||||
onChanged: (_) => onCompleted(),
|
||||
onChanged: canComplete ? (_) => onCompleted() : null,
|
||||
),
|
||||
title: Text(
|
||||
task.name,
|
||||
@@ -51,22 +59,25 @@ class CalendarTaskRow extends StatelessWidget {
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
subtitle: GestureDetector(
|
||||
onTap: () => context.go('/rooms/${taskWithRoom.roomId}'),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.secondaryContainer,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Text(
|
||||
taskWithRoom.roomName,
|
||||
style: theme.textTheme.labelSmall?.copyWith(
|
||||
color: theme.colorScheme.onSecondaryContainer,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
subtitle: showRoomTag
|
||||
? GestureDetector(
|
||||
onTap: () => context.go('/rooms/${taskWithRoom.roomId}'),
|
||||
child: Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.secondaryContainer,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Text(
|
||||
taskWithRoom.roomName,
|
||||
style: theme.textTheme.labelSmall?.copyWith(
|
||||
color: theme.colorScheme.onSecondaryContainer,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user