feat(notifications): day sheet notification types
Add daySheetId field to NotificationItem model (Brick-managed), extract notificationTitle/notificationIcon to top-level testable functions, add five day-sheet notification cases, and wire tap/banner routing for day-sheet detail and approvals tab. Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:tasq/screens/notifications/notifications_screen.dart';
|
||||
|
||||
void main() {
|
||||
group('notificationTitle', () {
|
||||
test('assignment guard (existing case unchanged)', () {
|
||||
expect(notificationTitle('assignment', 'Alice'), 'Alice assigned you');
|
||||
});
|
||||
|
||||
test('day_sheet_submitted', () {
|
||||
expect(
|
||||
notificationTitle('day_sheet_submitted', 'Bob'),
|
||||
'Bob submitted a day sheet',
|
||||
);
|
||||
});
|
||||
|
||||
test('day_sheet_disapproved', () {
|
||||
expect(
|
||||
notificationTitle('day_sheet_disapproved', 'Alice'),
|
||||
'Day sheet disapproved',
|
||||
);
|
||||
});
|
||||
|
||||
test('day_sheet_justified', () {
|
||||
expect(
|
||||
notificationTitle('day_sheet_justified', 'Bob'),
|
||||
'Bob justified a day sheet',
|
||||
);
|
||||
});
|
||||
|
||||
test('day_sheet_approved', () {
|
||||
expect(
|
||||
notificationTitle('day_sheet_approved', 'Alice'),
|
||||
'Day sheet approved',
|
||||
);
|
||||
});
|
||||
|
||||
test('day_sheet_digest', () {
|
||||
expect(
|
||||
notificationTitle('day_sheet_digest', 'System'),
|
||||
'Day sheets awaiting review',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
group('notificationIcon', () {
|
||||
test('assignment guard (existing case unchanged)', () {
|
||||
expect(notificationIcon('assignment'), Icons.assignment_ind_outlined);
|
||||
});
|
||||
|
||||
test('day_sheet_submitted', () {
|
||||
expect(
|
||||
notificationIcon('day_sheet_submitted'),
|
||||
Icons.assignment_turned_in_outlined,
|
||||
);
|
||||
});
|
||||
|
||||
test('day_sheet_disapproved', () {
|
||||
expect(
|
||||
notificationIcon('day_sheet_disapproved'),
|
||||
Icons.report_outlined,
|
||||
);
|
||||
});
|
||||
|
||||
test('day_sheet_justified', () {
|
||||
expect(
|
||||
notificationIcon('day_sheet_justified'),
|
||||
Icons.reply_outlined,
|
||||
);
|
||||
});
|
||||
|
||||
test('day_sheet_approved', () {
|
||||
expect(
|
||||
notificationIcon('day_sheet_approved'),
|
||||
Icons.verified_outlined,
|
||||
);
|
||||
});
|
||||
|
||||
test('day_sheet_digest', () {
|
||||
expect(
|
||||
notificationIcon('day_sheet_digest'),
|
||||
Icons.inbox_outlined,
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user