mirror of
https://github.com/flutter/samples.git
synced 2026-04-19 21:41:43 +00:00
Flutter 3.29 beta (#2571)
This commit is contained in:
@@ -60,8 +60,9 @@ void main() {
|
||||
});
|
||||
});
|
||||
|
||||
testWidgets('should select activity and confirm',
|
||||
(WidgetTester tester) async {
|
||||
testWidgets('should select activity and confirm', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await mockNetworkImages(() async {
|
||||
await loadScreen(tester);
|
||||
// Select one activity
|
||||
|
||||
@@ -20,9 +20,7 @@ void main() {
|
||||
|
||||
setUp(() {
|
||||
fakeAuthRepository = FakeAuthRepository();
|
||||
viewModel = LoginViewModel(
|
||||
authRepository: fakeAuthRepository,
|
||||
);
|
||||
viewModel = LoginViewModel(authRepository: fakeAuthRepository);
|
||||
goRouter = MockGoRouter();
|
||||
});
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@ void main() {
|
||||
fakeAuthRepository.token = 'TOKEN';
|
||||
// Setup an ItineraryConfig with some data, should be cleared after logout
|
||||
fakeItineraryConfigRepository = FakeItineraryConfigRepository(
|
||||
itineraryConfig: const ItineraryConfig(continent: 'CONTINENT'));
|
||||
itineraryConfig: const ItineraryConfig(continent: 'CONTINENT'),
|
||||
);
|
||||
viewModel = LogoutViewModel(
|
||||
authRepository: fakeAuthRepository,
|
||||
itineraryConfigRepository: fakeItineraryConfigRepository,
|
||||
|
||||
@@ -84,8 +84,9 @@ void main() {
|
||||
expect(find.text(kBooking.destination.tags.first), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('should create booking from itinerary config',
|
||||
(WidgetTester tester) async {
|
||||
testWidgets('should create booking from itinerary config', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await loadScreen(tester);
|
||||
|
||||
// Create a new booking from stored itinerary config
|
||||
|
||||
@@ -62,8 +62,9 @@ void main() {
|
||||
});
|
||||
});
|
||||
|
||||
testWidgets('should tap and navigate to activities',
|
||||
(WidgetTester tester) async {
|
||||
testWidgets('should tap and navigate to activities', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await mockNetworkImages(() async {
|
||||
await loadScreen(tester);
|
||||
|
||||
|
||||
@@ -25,8 +25,9 @@ void main() {
|
||||
await testApp(tester, SearchFormContinent(viewModel: viewModel));
|
||||
}
|
||||
|
||||
testWidgets('Should load and select continent',
|
||||
(WidgetTester tester) async {
|
||||
testWidgets('Should load and select continent', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await loadWidget(tester);
|
||||
expect(find.byType(SearchFormContinent), findsOneWidget);
|
||||
|
||||
|
||||
@@ -26,8 +26,9 @@ void main() {
|
||||
await testApp(tester, SearchFormDate(viewModel: viewModel));
|
||||
}
|
||||
|
||||
testWidgets('should display date in different month',
|
||||
(WidgetTester tester) async {
|
||||
testWidgets('should display date in different month', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await loadWidget(tester);
|
||||
expect(find.byType(SearchFormDate), findsOneWidget);
|
||||
|
||||
@@ -36,14 +37,17 @@ void main() {
|
||||
|
||||
// Simulate date picker input:
|
||||
viewModel.dateRange = DateTimeRange(
|
||||
start: DateTime(2024, 6, 12), end: DateTime(2024, 7, 23));
|
||||
start: DateTime(2024, 6, 12),
|
||||
end: DateTime(2024, 7, 23),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('12 Jun - 23 Jul'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('should display date in same month',
|
||||
(WidgetTester tester) async {
|
||||
testWidgets('should display date in same month', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await loadWidget(tester);
|
||||
expect(find.byType(SearchFormDate), findsOneWidget);
|
||||
|
||||
@@ -52,7 +56,9 @@ void main() {
|
||||
|
||||
// Simulate date picker input:
|
||||
viewModel.dateRange = DateTimeRange(
|
||||
start: DateTime(2024, 6, 12), end: DateTime(2024, 6, 23));
|
||||
start: DateTime(2024, 6, 12),
|
||||
end: DateTime(2024, 6, 23),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('12 - 23 Jun'), findsOneWidget);
|
||||
|
||||
@@ -46,8 +46,9 @@ void main() {
|
||||
);
|
||||
}
|
||||
|
||||
testWidgets('Should fill form and perform search',
|
||||
(WidgetTester tester) async {
|
||||
testWidgets('Should fill form and perform search', (
|
||||
WidgetTester tester,
|
||||
) async {
|
||||
await loadWidget(tester);
|
||||
expect(find.byType(SearchFormScreen), findsOneWidget);
|
||||
|
||||
@@ -56,7 +57,9 @@ void main() {
|
||||
|
||||
// Select date
|
||||
viewModel.dateRange = DateTimeRange(
|
||||
start: DateTime(2024, 6, 12), end: DateTime(2024, 7, 23));
|
||||
start: DateTime(2024, 6, 12),
|
||||
end: DateTime(2024, 7, 23),
|
||||
);
|
||||
|
||||
// Select guests
|
||||
await tester.tap(find.byKey(const ValueKey(addGuestsKey)));
|
||||
|
||||
Reference in New Issue
Block a user