forked from eatvio/eatvio_app
feat: Implement comprehensive navigation logic for various notification types within the NotificationWidget.
This commit is contained in:
@@ -101,7 +101,7 @@ void main() {
|
||||
|
||||
registerMocks(cubit, commentsCubit);
|
||||
|
||||
await tester.pumpWidget(wrap(cubit, feedCubit, commentsCubit, const AboutDietScreen(slug: 'test', id: null, index: null, navigateToComments: false)));
|
||||
await tester.pumpWidget(wrap(cubit, feedCubit, commentsCubit, const AboutDietScreen(slug: 'test', id: null, index: null, navigateToComments: false, highlightedCommentId: null)));
|
||||
await tester.pump();
|
||||
|
||||
expect(find.byType(AboutDietScreen), findsOneWidget);
|
||||
@@ -127,7 +127,7 @@ void main() {
|
||||
registerMocks(cubit, commentsCubit);
|
||||
|
||||
await mockNetworkImagesFor(() async {
|
||||
await tester.pumpWidget(wrap(cubit, feedCubit, commentsCubit, const AboutDietScreen(slug: 'test', id: null, index: null, navigateToComments: false)));
|
||||
await tester.pumpWidget(wrap(cubit, feedCubit, commentsCubit, const AboutDietScreen(slug: 'test', id: null, index: null, navigateToComments: false, highlightedCommentId: null)));
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 600));
|
||||
});
|
||||
@@ -157,7 +157,7 @@ void main() {
|
||||
registerMocks(cubit, commentsCubit);
|
||||
|
||||
await mockNetworkImagesFor(() async {
|
||||
await tester.pumpWidget(wrap(cubit, feedCubit, commentsCubit, const AboutDietScreen(slug: 'test', id: null, index: null, navigateToComments: false)));
|
||||
await tester.pumpWidget(wrap(cubit, feedCubit, commentsCubit, const AboutDietScreen(slug: 'test', id: null, index: null, navigateToComments: false, highlightedCommentId: null)));
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 600));
|
||||
});
|
||||
@@ -183,7 +183,7 @@ void main() {
|
||||
|
||||
registerMocks(cubit, commentsCubit);
|
||||
|
||||
await tester.pumpWidget(wrap(cubit, feedCubit, commentsCubit, const AboutDietScreen(slug: 'test', id: null, index: null, navigateToComments: false)));
|
||||
await tester.pumpWidget(wrap(cubit, feedCubit, commentsCubit, const AboutDietScreen(slug: 'test', id: null, index: null, navigateToComments: false, highlightedCommentId: null)));
|
||||
await tester.pump();
|
||||
|
||||
expect(find.byType(AboutDietScreen), findsOneWidget);
|
||||
|
||||
@@ -124,7 +124,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('UnknownNotification uses default createdAt when not provided', () {
|
||||
final notification = UnknownNotification(type: NotificationType.unknown);
|
||||
final notification = UnknownNotification(type: NotificationType.unknown, createdAt: DateTime.now());
|
||||
|
||||
expect(notification.type, NotificationType.unknown);
|
||||
expect(notification.isRead, true);
|
||||
|
||||
@@ -160,6 +160,8 @@ void main() {
|
||||
type: NotificationType.chosenPlanStartedToConsultant,
|
||||
planName: 'Test Plan',
|
||||
customerName: 'Test Customer',
|
||||
planId: 1,
|
||||
customerId: 1,
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -586,6 +588,8 @@ void main() {
|
||||
type: NotificationType.stayOnTrackToAuthor,
|
||||
planName: 'Test Plan',
|
||||
clientName: 'Test Client',
|
||||
planId: 1,
|
||||
clientId: 1,
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -752,6 +756,8 @@ void main() {
|
||||
type: NotificationType.stayOnTrackToCustomer,
|
||||
planName: 'Test Plan',
|
||||
consultantName: 'Test Consultant',
|
||||
planId: 1,
|
||||
consultantId: 1,
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
|
||||
@@ -123,7 +123,7 @@ void main() {
|
||||
|
||||
registerMocks(planCubit, commentsCubit);
|
||||
|
||||
await tester.pumpWidget(wrap(planCubit, feedCubit, commentsCubit, const AboutPlanScreen(slug: 'test', navigateToComments: false, index: null)));
|
||||
await tester.pumpWidget(wrap(planCubit, feedCubit, commentsCubit, const AboutPlanScreen(slug: 'test', navigateToComments: false, index: null, highlightedCommentId: null)));
|
||||
await tester.pump();
|
||||
|
||||
expect(find.byType(AboutPlanScreen), findsOneWidget);
|
||||
@@ -149,7 +149,7 @@ void main() {
|
||||
registerMocks(planCubit, commentsCubit);
|
||||
|
||||
await mockNetworkImagesFor(() async {
|
||||
await tester.pumpWidget(wrap(planCubit, feedCubit, commentsCubit, const AboutPlanScreen(slug: 'test', navigateToComments: false, index: null)));
|
||||
await tester.pumpWidget(wrap(planCubit, feedCubit, commentsCubit, const AboutPlanScreen(slug: 'test', navigateToComments: false, index: null, highlightedCommentId: null)));
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
});
|
||||
@@ -177,7 +177,7 @@ void main() {
|
||||
|
||||
registerMocks(planCubit, commentsCubit);
|
||||
|
||||
await tester.pumpWidget(wrap(planCubit, feedCubit, commentsCubit, const AboutPlanScreen(slug: 'test', navigateToComments: false, index: null)));
|
||||
await tester.pumpWidget(wrap(planCubit, feedCubit, commentsCubit, const AboutPlanScreen(slug: 'test', navigateToComments: false, index: null, highlightedCommentId: null)));
|
||||
await tester.pump();
|
||||
|
||||
expect(find.byType(AboutPlanScreen), findsOneWidget);
|
||||
|
||||
Reference in New Issue
Block a user