Skip to content

Commit

Permalink
revert package.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayankpulse333 committed Jan 3, 2025
1 parent 76cde66 commit ec88674
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 65 deletions.
20 changes: 10 additions & 10 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.0.5"
version: "6.1.1"
connectivity_plus_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -601,10 +601,10 @@ packages:
dependency: "direct main"
description:
name: get_it
sha256: c49895c1ecb0ee2a0ec568d39de882e2c299ba26355aa6744ab1001f98cebd15
sha256: f126a3e286b7f5b578bf436d5592968706c4c1de28a228b870ce375d9f743103
url: "https://pub.dev"
source: hosted
version: "8.0.2"
version: "8.0.3"
glob:
dependency: transitive
description:
Expand Down Expand Up @@ -1438,26 +1438,26 @@ packages:
dependency: "direct main"
description:
name: syncfusion_flutter_calendar
sha256: "948934cecada4fd977a1097a3ac6c69857b1838b26438da1b2d58e667fa81f45"
sha256: "20118a598cf5ae5b7ec84fa364e2b51070800f078466158fcd25864e1b5a2cfd"
url: "https://pub.dev"
source: hosted
version: "27.2.4"
version: "27.2.5"
syncfusion_flutter_core:
dependency: transitive
description:
name: syncfusion_flutter_core
sha256: "795530addc930b3b06f4f2fe99a039de276860af505fcf54c4516fbcb838a3cb"
sha256: "325f519ce4ad8edd81811c21b853d72018529e353584490824da0555156ba076"
url: "https://pub.dev"
source: hosted
version: "27.2.4"
version: "27.2.5"
syncfusion_flutter_datepicker:
dependency: "direct main"
description:
name: syncfusion_flutter_datepicker
sha256: eafdcb6084a3c50d482cf846a59dac86bee3cc3511f62f3b69fea14133ab57be
sha256: 2177e49eb8a1c0fce7081e40f5613c986d00e5e63cbeb98a6012f65ca156bfc7
url: "https://pub.dev"
source: hosted
version: "27.2.4"
version: "27.2.5"
synchronized:
dependency: transitive
description:
Expand Down Expand Up @@ -1795,4 +1795,4 @@ packages:
version: "3.1.2"
sdks:
dart: ">=3.5.0 <=3.22.3"
flutter: ">=3.22.0"
flutter: ">=3.22.0"
Original file line number Diff line number Diff line change
Expand Up @@ -501,35 +501,61 @@ Future<void> main() async {
); // Ensure it has primary focus
});

testWidgets("Testing if image removal works", (tester) async {
testWidgets("Testing image selection and removal functionality",
(tester) async {
await mockNetworkImages(() async {
// Mock user data with an image set
// Mock user data with no image
userConfig.updateUser(
User(firstName: 'Test', lastName: 'Test', email: '[email protected]'),
);

// Create a mock ViewModel
final model = EditProfilePageViewModel();
model.imageFile = File('mockPath'); // Set a mock image initially
model.notifyListeners(); // Trigger the listener to update the UI

// Render the widget
await tester
.pumpWidget(createEditProfilePage(themeMode: ThemeMode.dark));
await tester.pumpAndSettle();

// Ensure the remove button is visible
// Case 1: Image file is null (modal sheet for selection should appear)
final addRemoveButton = find.byKey(const Key('AddRemoveImageButton'));
expect(addRemoveButton, findsOneWidget);

// Simulate tapping the remove button
// Ensure the button is visible before interacting
await tester.ensureVisible(addRemoveButton);
await tester.pumpAndSettle();

// Tap the button to trigger modal sheet for image selection
await tester.tap(addRemoveButton);
await tester.pumpAndSettle();

// Verify modal sheet appears with options
expect(find.text('Camera'), findsOneWidget);
expect(find.text('Gallery'), findsOneWidget);
expect(find.byIcon(Icons.camera_alt), findsOneWidget);
expect(find.byIcon(Icons.photo_library), findsOneWidget);

// Close the modal sheet
await tester.tap(find.text('Camera'));
await tester.pumpAndSettle();

// Mock setting an image file
final model = EditProfilePageViewModel();
model.imageFile = File('mockPath');

// Rebuild the widget to reflect the new state
await tester
.pumpWidget(createEditProfilePage(themeMode: ThemeMode.dark));
await tester.pumpAndSettle();

// Case 2: Image file is not null (image removal should be triggered)
await tester.ensureVisible(addRemoveButton);
await tester.tap(addRemoveButton);
await tester.pumpAndSettle();

// Call `model.removeImage` directly
model.removeImage();
// Mock removing the image file
model.imageFile = null;
model.notifyListeners();
await tester.pumpAndSettle();

// Verify the image file is set to null
// Verify the image file is removed
expect(model.imageFile, isNull);
});
});
Expand Down
43 changes: 0 additions & 43 deletions test/widget_tests/widgets/recurrence_dialog_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -256,48 +256,5 @@ 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 ec88674

Please sign in to comment.