Skip to content

Commit

Permalink
increasing recursive dialog test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayankpulse333 committed Jan 3, 2025
1 parent fd90cd6 commit 76cde66
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ packages:
sha256: "2056db5241f96cdc0126bd94459fc4cdc13876753768fc7a31c425e50a7177d0"
url: "https://pub.dev"
source: hosted
version: "6.1.1"
version: "6.0.5"
connectivity_plus_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -601,10 +601,10 @@ packages:
dependency: "direct main"
description:
name: get_it
sha256: f126a3e286b7f5b578bf436d5592968706c4c1de28a228b870ce375d9f743103
sha256: c49895c1ecb0ee2a0ec568d39de882e2c299ba26355aa6744ab1001f98cebd15
url: "https://pub.dev"
source: hosted
version: "8.0.3"
version: "8.0.2"
glob:
dependency: transitive
description:
Expand Down Expand Up @@ -1438,26 +1438,26 @@ packages:
dependency: "direct main"
description:
name: syncfusion_flutter_calendar
sha256: "20118a598cf5ae5b7ec84fa364e2b51070800f078466158fcd25864e1b5a2cfd"
sha256: "948934cecada4fd977a1097a3ac6c69857b1838b26438da1b2d58e667fa81f45"
url: "https://pub.dev"
source: hosted
version: "27.2.5"
version: "27.2.4"
syncfusion_flutter_core:
dependency: transitive
description:
name: syncfusion_flutter_core
sha256: "325f519ce4ad8edd81811c21b853d72018529e353584490824da0555156ba076"
sha256: "795530addc930b3b06f4f2fe99a039de276860af505fcf54c4516fbcb838a3cb"
url: "https://pub.dev"
source: hosted
version: "27.2.5"
version: "27.2.4"
syncfusion_flutter_datepicker:
dependency: "direct main"
description:
name: syncfusion_flutter_datepicker
sha256: "2177e49eb8a1c0fce7081e40f5613c986d00e5e63cbeb98a6012f65ca156bfc7"
sha256: eafdcb6084a3c50d482cf846a59dac86bee3cc3511f62f3b69fea14133ab57be
url: "https://pub.dev"
source: hosted
version: "27.2.5"
version: "27.2.4"
synchronized:
dependency: transitive
description:
Expand Down
43 changes: 43 additions & 0 deletions test/widget_tests/widgets/recurrence_dialog_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -256,5 +256,48 @@ void main() {
},
);
});

testWidgets('handles last weekday occurrence for various dates',
(tester) async {
// Test for leap year February
model.recurrenceStartDate = DateTime(2024, 2, 29); // Leap year
await tester.pumpWidget(
MaterialApp(
home: ShowRecurrenceDialog(model: model),
),
);
expect(
find.text(
RecurrenceUtils.getRecurrenceRuleText(
Frequency.monthly,
{'THURSDAY'},
model.interval,
model.count,
-1,
model.recurrenceStartDate,
model.recurrenceEndDate,
),
),
findsOneWidget,
);

// Test for non-leap year February
model.recurrenceStartDate = DateTime(2023, 2, 28); // Non-leap year
await tester.pump();
expect(
find.text(
RecurrenceUtils.getRecurrenceRuleText(
Frequency.monthly,
{'TUESDAY'},
model.interval,
model.count,
-1,
model.recurrenceStartDate,
model.recurrenceEndDate,
),
),
findsOneWidget,
);
});
});
}

0 comments on commit 76cde66

Please sign in to comment.