forked from eatvio/eatvio_app
feat(tests): fixed notifications tests
This commit is contained in:
@@ -31,8 +31,12 @@ void main() {
|
||||
final notification = PlanSubscriptionStartedToAuthorNotification(
|
||||
type: NotificationType.planSubscriptionStartedToAuthor,
|
||||
planName: 'Test Plan',
|
||||
planId: 1,
|
||||
customerName: 'Test Customer',
|
||||
userId: 0,
|
||||
userPhotoPath: '',
|
||||
chatId: 'chat123',
|
||||
chatUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -47,7 +51,11 @@ void main() {
|
||||
final notification = PlanSubscriptionCanceledToAuthorNotification(
|
||||
type: NotificationType.planSubscriptionCanceledToAuthor,
|
||||
planName: 'Test Plan',
|
||||
planId: 1,
|
||||
customerName: 'Test Customer',
|
||||
userId: 0,
|
||||
userPhotoPath: '',
|
||||
chatUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -63,6 +71,8 @@ void main() {
|
||||
type: NotificationType.chosenPlanStartedToClient,
|
||||
planName: 'Test Plan',
|
||||
planId: 1,
|
||||
consultantName: 'Test Consultant',
|
||||
peerProfileUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -77,6 +87,8 @@ void main() {
|
||||
final notification = ChosenPlanTomorrowReminderToClientNotification(
|
||||
type: NotificationType.chosenPlanTomorrowReminderToClient,
|
||||
planName: 'Test Plan',
|
||||
consultantName: '',
|
||||
chatId: 0,
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -103,7 +115,12 @@ void main() {
|
||||
testWidgets('displays ConsultantLeftCommentNotification', (tester) async {
|
||||
final notification = ConsultantLeftCommentNotification(
|
||||
type: NotificationType.consultantLeftComment,
|
||||
chosenPlanId: 1,
|
||||
diaryId: 0,
|
||||
date: testDate,
|
||||
planName: '',
|
||||
userName: '',
|
||||
consultantName: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -131,6 +148,11 @@ void main() {
|
||||
final notification = ChosenPlanFinishedToClientNotification(
|
||||
type: NotificationType.chosenPlanFinishedToClient,
|
||||
planName: 'Test Plan',
|
||||
chosenPlanId: 1,
|
||||
consultantName: '',
|
||||
consultantPhotoPath: '',
|
||||
consultantProfileUrl: '',
|
||||
consultantId: 0,
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -145,6 +167,11 @@ void main() {
|
||||
final notification = PlanSubscriptionCanceledToCustomerNotification(
|
||||
type: NotificationType.planSubscriptionCanceledToCustomer,
|
||||
planName: 'Test Plan',
|
||||
planId: 1,
|
||||
authorName: '',
|
||||
authorId: 0,
|
||||
authorPhotoPath: '',
|
||||
chatUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -162,6 +189,8 @@ void main() {
|
||||
customerName: 'Test Customer',
|
||||
planId: 1,
|
||||
customerId: 1,
|
||||
peerProfileUrl: '',
|
||||
consultationUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -177,6 +206,7 @@ void main() {
|
||||
type: NotificationType.chosenPlanTomorrowReminderToConsultant,
|
||||
planName: 'Test Plan',
|
||||
customerName: 'Test Customer',
|
||||
chatId: 0,
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -191,7 +221,11 @@ void main() {
|
||||
final notification = PlanSubscriptionPaidToAuthorNotification(
|
||||
type: NotificationType.planSubscriptionPaidToAuthor,
|
||||
planName: 'Test Plan',
|
||||
planId: 1,
|
||||
customerName: 'Test Customer',
|
||||
userId: 0,
|
||||
userPhotoPath: '',
|
||||
chatUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -208,6 +242,9 @@ void main() {
|
||||
planName: 'Test Plan',
|
||||
customerName: 'Test Customer',
|
||||
planId: 1,
|
||||
chosenPlanId: 1,
|
||||
clientPhotoPath: '',
|
||||
clientId: 0,
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -221,6 +258,10 @@ void main() {
|
||||
testWidgets('displays ChosenPlanLastDayFinishedForUser', (tester) async {
|
||||
final notification = ChosenPlanLastDayFinishedForUser(
|
||||
type: NotificationType.chosenPlanLastDayFinishedForUser,
|
||||
planName: 'Test Plan',
|
||||
chosenPlanId: 1,
|
||||
complaintUrl: '',
|
||||
chatUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -254,6 +295,7 @@ void main() {
|
||||
message: 'Test message',
|
||||
entityId: 1,
|
||||
entityType: 'test',
|
||||
entityName: 'Test Entity',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -472,6 +514,7 @@ void main() {
|
||||
final notification = DietCancelledNotification(
|
||||
type: NotificationType.dietCancelled,
|
||||
dietName: 'Test Diet',
|
||||
dietId: 1,
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -486,6 +529,7 @@ void main() {
|
||||
final notification = DietStartedNotification(
|
||||
type: NotificationType.dietStarted,
|
||||
dietName: 'Test Diet',
|
||||
dietId: 1,
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -500,6 +544,7 @@ void main() {
|
||||
final notification = DietExpiredNotification(
|
||||
type: NotificationType.dietExpired,
|
||||
dietName: 'Test Diet',
|
||||
dietId: 1,
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -514,6 +559,7 @@ void main() {
|
||||
final notification = DietWillStartedInNotification(
|
||||
type: NotificationType.dietWillStartedIn,
|
||||
dietName: 'Test Diet',
|
||||
dietId: 1,
|
||||
startDate: '2024-02-01',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
@@ -529,6 +575,7 @@ void main() {
|
||||
final notification = DietCanNotBeStartedNotification(
|
||||
type: NotificationType.dietCanNotBeStarted,
|
||||
dietName: 'Test Diet',
|
||||
dietId: 1,
|
||||
reason: 'Test reason',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
@@ -543,8 +590,9 @@ void main() {
|
||||
testWidgets('displays PersonalDietCreationNeededNotification', (tester) async {
|
||||
final notification = PersonalDietCreationNeededNotification(
|
||||
type: NotificationType.personalDietCreationNeeded,
|
||||
planName: 'Test Plan',
|
||||
clientName: 'Test Client',
|
||||
userName: 'Test Client',
|
||||
consultantName: '',
|
||||
myDietsUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -559,6 +607,9 @@ void main() {
|
||||
final notification = ChosenPlanClientLastDayFinishedNotification(
|
||||
type: NotificationType.chosenPlanClientLastDayFinished,
|
||||
planName: 'Test Plan',
|
||||
chosenPlanId: 1,
|
||||
complaintUrl: '',
|
||||
chatUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -573,6 +624,8 @@ void main() {
|
||||
final notification = ChosenPlanClientLastDayStartedNotification(
|
||||
type: NotificationType.chosenPlanClientLastDayStarted,
|
||||
planName: 'Test Plan',
|
||||
chosenPlanId: 1,
|
||||
lastDayDiaryUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -587,9 +640,9 @@ void main() {
|
||||
final notification = StayOnTrackToAuthorNotification(
|
||||
type: NotificationType.stayOnTrackToAuthor,
|
||||
planName: 'Test Plan',
|
||||
clientName: 'Test Client',
|
||||
planId: 1,
|
||||
clientId: 1,
|
||||
userName: 'Test Client',
|
||||
dayNum: 1,
|
||||
diaryDayId: 0,
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -604,6 +657,13 @@ void main() {
|
||||
final notification = ClientStartPlanSubscriptionToSubscriberNotification(
|
||||
type: NotificationType.clientStartPlanSubscriptionToSubscriber,
|
||||
planName: 'Test Plan',
|
||||
planId: 1,
|
||||
authorName: '',
|
||||
authorId: 0,
|
||||
authorPhotoPath: '',
|
||||
chatUrl: '',
|
||||
chatId: '',
|
||||
startDate: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -618,7 +678,11 @@ void main() {
|
||||
final notification = ConsultantConfirmPlanSubscriptionToSubscriberNotification(
|
||||
type: NotificationType.consultantConfirmPlanSubscriptionToSubscriber,
|
||||
planName: 'Test Plan',
|
||||
planId: 1,
|
||||
consultantName: 'Test Consultant',
|
||||
authorId: 0,
|
||||
authorPhotoPath: '',
|
||||
chatUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -633,8 +697,11 @@ void main() {
|
||||
final notification = ClientPaidPlanSubscriptionToAuthorNotification(
|
||||
type: NotificationType.clientPaidPlanSubscriptionToAuthor,
|
||||
planName: 'Test Plan',
|
||||
planId: 1,
|
||||
clientName: 'Test Client',
|
||||
amount: 100.0,
|
||||
userId: 0,
|
||||
userPhotoPath: '',
|
||||
chatUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -648,7 +715,10 @@ void main() {
|
||||
testWidgets('displays ConsultantLeftDiaryCommentNotification', (tester) async {
|
||||
final notification = ConsultantLeftDiaryCommentNotification(
|
||||
type: NotificationType.consultantLeftDiaryComment,
|
||||
chosenPlanId: 1,
|
||||
diaryId: 0,
|
||||
planName: 'Test Plan',
|
||||
userName: '',
|
||||
consultantName: 'Test Consultant',
|
||||
diaryDate: testDate,
|
||||
isRead: false,
|
||||
@@ -665,7 +735,11 @@ void main() {
|
||||
final notification = ConsultantConfirmPlanSubscriptionToAuthorNotification(
|
||||
type: NotificationType.consultantConfirmPlanSubscriptionToAuthor,
|
||||
planName: 'Test Plan',
|
||||
consultantName: 'Test Consultant',
|
||||
planId: 1,
|
||||
clientName: 'Test Consultant',
|
||||
userId: 0,
|
||||
userPhotoPath: '',
|
||||
chatUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -680,7 +754,11 @@ void main() {
|
||||
final notification = ClientPaidPlanSubscriptionToSubscriberNotification(
|
||||
type: NotificationType.clientPaidPlanSubscriptionToSubscriber,
|
||||
planName: 'Test Plan',
|
||||
amount: 100.0,
|
||||
planId: 1,
|
||||
authorName: '',
|
||||
authorId: 0,
|
||||
authorPhotoPath: '',
|
||||
chatUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -695,7 +773,12 @@ void main() {
|
||||
final notification = ClientStartPlanSubscriptionToAuthorNotification(
|
||||
type: NotificationType.clientStartPlanSubscriptionToAuthor,
|
||||
planName: 'Test Plan',
|
||||
planId: 1,
|
||||
clientName: 'Test Client',
|
||||
userId: 0,
|
||||
userPhotoPath: '',
|
||||
chatId: '',
|
||||
chatUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -710,7 +793,11 @@ void main() {
|
||||
final notification = ClientCancelPlanSubscriptionToAuthorNotification(
|
||||
type: NotificationType.clientCancelPlanSubscriptionToAuthor,
|
||||
planName: 'Test Plan',
|
||||
planId: 1,
|
||||
clientName: 'Test Client',
|
||||
userId: 0,
|
||||
userPhotoPath: '',
|
||||
chatUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -725,6 +812,11 @@ void main() {
|
||||
final notification = ClientCancelPlanSubscriptionToSubscriberNotification(
|
||||
type: NotificationType.clientCancelPlanSubscriptionToSubscriber,
|
||||
planName: 'Test Plan',
|
||||
planId: 1,
|
||||
authorName: '',
|
||||
authorId: 0,
|
||||
authorPhotoPath: '',
|
||||
chatUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -738,9 +830,11 @@ void main() {
|
||||
testWidgets('displays UserDailyReportCompletedNotification', (tester) async {
|
||||
final notification = UserDailyReportCompletedNotification(
|
||||
type: NotificationType.userDailyReportCompleted,
|
||||
chosenPlanId: 1,
|
||||
diaryId: 0,
|
||||
planName: 'Test Plan',
|
||||
clientName: 'Test Client',
|
||||
reportDate: testDate,
|
||||
consultantName: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -755,9 +849,8 @@ void main() {
|
||||
final notification = StayOnTrackToCustomerNotification(
|
||||
type: NotificationType.stayOnTrackToCustomer,
|
||||
planName: 'Test Plan',
|
||||
consultantName: 'Test Consultant',
|
||||
planId: 1,
|
||||
consultantId: 1,
|
||||
dayNum: 1,
|
||||
diaryDayId: 0,
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -786,8 +879,9 @@ void main() {
|
||||
testWidgets('displays SubscriptionNotification', (tester) async {
|
||||
final notification = SubscriptionNotification(
|
||||
type: NotificationType.subscription,
|
||||
subscriptionType: 'monthly',
|
||||
planName: 'Test Plan',
|
||||
userName: '',
|
||||
userPhotoPath: '',
|
||||
userProfileUrl: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -801,8 +895,9 @@ void main() {
|
||||
testWidgets('displays BadgeAwardedNotification', (tester) async {
|
||||
final notification = BadgeAwardedNotification(
|
||||
type: NotificationType.badgeAwarded,
|
||||
badgeName: 'Test Badge',
|
||||
badgeDescription: 'Test Description',
|
||||
badgeTitle: 'Test Badge',
|
||||
badgeType: '',
|
||||
badgeImage: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -816,8 +911,9 @@ void main() {
|
||||
testWidgets('displays BadgeRevokedNotification', (tester) async {
|
||||
final notification = BadgeRevokedNotification(
|
||||
type: NotificationType.badgeRevoked,
|
||||
badgeName: 'Test Badge',
|
||||
reason: 'Test reason',
|
||||
badgeTitle: 'Test Badge',
|
||||
badgeType: '',
|
||||
badgeImage: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -845,8 +941,7 @@ void main() {
|
||||
testWidgets('displays ClientCloseComplaintSuccessNotification', (tester) async {
|
||||
final notification = ClientCloseComplaintSuccessNotification(
|
||||
type: NotificationType.clientCloseComplaintSuccess,
|
||||
complaintType: 'test',
|
||||
entityName: 'Test Entity',
|
||||
planName: 'Test Plan',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -893,7 +988,6 @@ void main() {
|
||||
final notification = ClientRejectSuccessNotification(
|
||||
type: NotificationType.clientRejectSuccess,
|
||||
planName: 'Test Plan',
|
||||
reason: 'Test reason',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -909,7 +1003,6 @@ void main() {
|
||||
type: NotificationType.consultantRejectSuccess,
|
||||
planName: 'Test Plan',
|
||||
clientName: 'Test Client',
|
||||
reason: 'Test reason',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -943,8 +1036,12 @@ void main() {
|
||||
final notification = ProductStatusUpdatedForAuthorNotification(
|
||||
type: NotificationType.productStatusUpdatedForAuthor,
|
||||
productName: 'Test Product',
|
||||
oldStatus: 'pending',
|
||||
newStatus: 'approved',
|
||||
productId: 1,
|
||||
author: '',
|
||||
authorId: 0,
|
||||
status: 'approved',
|
||||
subject: '',
|
||||
messageLine: '',
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
);
|
||||
@@ -973,8 +1070,15 @@ void main() {
|
||||
type: NotificationType.personalDietIsDefinedToCustomer,
|
||||
isRead: false,
|
||||
createdAt: testDate,
|
||||
dietName: 'Test Diet',
|
||||
chosenPlanId: 1,
|
||||
dietId: 1,
|
||||
planName: '',
|
||||
userName: '',
|
||||
consultantName: '',
|
||||
dietName: 'Test Diet',
|
||||
role: '',
|
||||
peerSlug: '',
|
||||
peerImagePath: '',
|
||||
);
|
||||
|
||||
await tester.pumpWidget(createTestWidget(notification));
|
||||
|
||||
Reference in New Issue
Block a user