Skip to content

Commit

Permalink
Add hotel animated list view goldens
Browse files Browse the repository at this point in the history
  • Loading branch information
DDavidPrime committed Aug 12, 2024
1 parent 3bc3864 commit b524de5
Show file tree
Hide file tree
Showing 34 changed files with 76 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import 'package:booking_app/base/common_blocs/hotels_extra_details_bloc.dart';
import 'package:booking_app/feature_hotel_search/blocs/hotel_search_bloc.dart';
import 'package:booking_app/feature_hotel_search/models/capacity_filter_data.dart';
import 'package:booking_app/feature_hotel_search/models/date_range_filter_data.dart';
import 'package:booking_app/feature_hotel_search/ui_components/hotel_animated_list_view.dart';
import 'package:favorites_advanced_base/core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_rx_bloc/flutter_rx_bloc.dart';
import 'package:provider/provider.dart';
import 'package:rx_bloc_list/rx_bloc_list.dart';
import 'package:rxdart/rxdart.dart';

import '../../feature_home/mock/hotel_extra_details_mock.dart';
import '../mock/hotel_search_mock.dart';

/// Change the parameters according the the needs of the test
Widget hotelAnimatedListViewFactory({
required PaginatedList<Hotel> hotels,
Function(Hotel)? onHotelPressed,
String? hotelsFound,
String? queryFilter,
DateRangeFilterData? dateRangeFilterData,
CapacityFilterData? capacityFilterData,
SortBy? sortedBy,
}) {
return Scaffold(
body: MultiProvider(
providers: [
RxBlocProvider<HotelsExtraDetailsBlocType>.value(
value: hotelsExtraDetailsMockFactory(),
),
RxBlocProvider<HotelSearchBlocType>.value(
value: hotelSearchMockFactory(
hotels: hotels,
hotelsFound: hotelsFound,
queryFilter: queryFilter,
dateRangeFilterData: dateRangeFilterData,
capacityFilterData: capacityFilterData,
sortedBy: sortedBy,
),
),
],
child: HotelAnimatedListView(
hotelList: Stream.value(hotels.list).share(),
onHotelPressed: onHotelPressed,
),
),
);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import '../../helpers/golden_helper.dart';
import '../../helpers/models/scenario.dart';
import '../../stubs.dart';
import '../factory/hotel_animated_list_view_factory.dart';

void main() {
runGoldenTests([
generateDeviceBuilder(
scenario: Scenario(name: 'hotel_animated_list_view_empty'),
widget: hotelAnimatedListViewFactory(
hotels: Stub.paginatedListEmpty,
),
),
generateDeviceBuilder(
scenario: Scenario(name: 'hotel_animated_list_view_with_hotels'),
widget: hotelAnimatedListViewFactory(
hotels: Stub.paginatedListTwoHotels,
),
),
generateDeviceBuilder(
scenario: Scenario(name: 'hotel_animated_list_view_error'),
widget: hotelAnimatedListViewFactory(
hotels: Stub.paginatedListError,
),
),
]);
}

0 comments on commit b524de5

Please sign in to comment.