-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #902 from Prime-Holding/feature/864-update-goldens…
…-in-reminder-app-with-alchemist Feature/864 update goldens in reminder app with alchemist
- Loading branch information
Showing
79 changed files
with
1,390 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
examples/reminders/lib/feature_dashboard/blocs/dashboard_bloc.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
examples/reminders/test/feature_dashboard/factory/dashboard_factory.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_rx_bloc/flutter_rx_bloc.dart'; | ||
import 'package:provider/provider.dart'; | ||
import 'package:reminders/base/common_blocs/firebase_bloc.dart'; | ||
import 'package:reminders/base/models/reminder/reminder_model.dart'; | ||
import 'package:reminders/feature_dashboard/blocs/dashboard_bloc.dart'; | ||
import 'package:reminders/feature_dashboard/models/dashboard_model.dart'; | ||
import 'package:reminders/feature_dashboard/views/dashboard_page.dart'; | ||
import 'package:reminders/feature_reminder_manage/blocs/reminder_manage_bloc.dart'; | ||
import 'package:rx_bloc/rx_bloc.dart'; | ||
import 'package:rx_bloc_list/models.dart'; | ||
|
||
import '../../mocks/bloc_mocks.dart'; | ||
import '../../mocks/reminder_manage_mock.dart'; | ||
import '../mock/dashboard_mock.dart'; | ||
|
||
Widget dashboardFactory({ | ||
bool? isLoading, | ||
String? errors, | ||
Result<DashboardCountersModel>? dashboardCounters, | ||
PaginatedList<ReminderModel>? reminderModels, | ||
}) => | ||
Scaffold( | ||
body: MultiProvider(providers: [ | ||
RxBlocProvider<ReminderManageBlocType>.value( | ||
value: reminderManageMockFactory()), | ||
RxBlocProvider<FirebaseBlocType>.value(value: createFirebaseBlocMock()), | ||
RxBlocProvider<DashboardBlocType>.value( | ||
value: dashboardMockFactory( | ||
isLoading: isLoading, | ||
errors: errors, | ||
dashboardCounters: dashboardCounters, | ||
reminderModels: reminderModels, | ||
), | ||
), | ||
], child: DashboardPage()), | ||
); |
48 changes: 48 additions & 0 deletions
48
examples/reminders/test/feature_dashboard/mock/dashboard_mock.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import 'package:mockito/annotations.dart'; | ||
import 'package:mockito/mockito.dart'; | ||
import 'package:reminders/base/models/reminder/reminder_model.dart'; | ||
import 'package:reminders/feature_dashboard/blocs/dashboard_bloc.dart'; | ||
import 'package:reminders/feature_dashboard/models/dashboard_model.dart'; | ||
import 'package:rx_bloc/rx_bloc.dart'; | ||
import 'package:rx_bloc_list/models.dart'; | ||
import 'package:rxdart/rxdart.dart'; | ||
|
||
import 'dashboard_mock.mocks.dart'; | ||
|
||
@GenerateMocks([DashboardBlocStates, DashboardBlocEvents, DashboardBlocType]) | ||
DashboardBlocType dashboardMockFactory({ | ||
bool? isLoading, | ||
String? errors, | ||
Result<DashboardCountersModel>? dashboardCounters, | ||
PaginatedList<ReminderModel>? reminderModels, | ||
}) { | ||
final blocMock = MockDashboardBlocType(); | ||
final eventsMock = MockDashboardBlocEvents(); | ||
final statesMock = MockDashboardBlocStates(); | ||
|
||
when(blocMock.events).thenReturn(eventsMock); | ||
when(blocMock.states).thenReturn(statesMock); | ||
|
||
final isLoadingState = isLoading != null | ||
? Stream.value(isLoading).shareReplay(maxSize: 1) | ||
: const Stream<bool>.empty(); | ||
|
||
final errorsState = errors != null | ||
? Stream.value(errors).shareReplay(maxSize: 1) | ||
: const Stream<String>.empty(); | ||
|
||
final dashboardCountersState = dashboardCounters != null | ||
? Stream.value(dashboardCounters).shareReplay(maxSize: 1) | ||
: const Stream<Result<DashboardCountersModel>>.empty(); | ||
|
||
final reminderModelsState = reminderModels != null | ||
? Stream.value(reminderModels).shareReplay(maxSize: 1) | ||
: const Stream<PaginatedList<ReminderModel>>.empty(); | ||
|
||
when(statesMock.isLoading).thenAnswer((_) => isLoadingState); | ||
when(statesMock.errors).thenAnswer((_) => errorsState); | ||
when(statesMock.dashboardCounters).thenAnswer((_) => dashboardCountersState); | ||
when(statesMock.reminderModels).thenAnswer((_) => reminderModelsState); | ||
|
||
return blocMock; | ||
} |
27 changes: 27 additions & 0 deletions
27
examples/reminders/test/feature_dashboard/view/dashboard_golden_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'package:rx_bloc/rx_bloc.dart'; | ||
|
||
import '../../helpers/golden_helper.dart'; | ||
import '../../stubs.dart'; | ||
import '../factory/dashboard_factory.dart'; | ||
|
||
void main() { | ||
runGoldenTests([ | ||
buildScenario(widget: dashboardFactory(), scenario: 'dashboard_empty'), | ||
buildScenario( | ||
widget: dashboardFactory( | ||
dashboardCounters: Result.success(Stubs.dashboardCountersModel), | ||
reminderModels: Stubs.reminderPaginatedList, | ||
), //example: Stubs.success | ||
scenario: 'dashboard_success'), | ||
buildScenario( | ||
widget: dashboardFactory(dashboardCounters: Result.loading()), | ||
scenario: 'dashboard_loading', | ||
customPumpBeforeTest: (tester) => | ||
tester.pump(const Duration(milliseconds: 300))), | ||
buildScenario( | ||
widget: dashboardFactory( | ||
dashboardCounters: Result.error(Stubs.throwable), | ||
errors: Stubs.errorNoConnection), | ||
scenario: 'dashboard_error') | ||
]); | ||
} |
Binary file added
BIN
+68.2 KB
...reminders/test/feature_dashboard/view/goldens/ci/dark_theme/dashboard_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+82.3 KB
...reminders/test/feature_dashboard/view/goldens/ci/dark_theme/dashboard_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+68.4 KB
...minders/test/feature_dashboard/view/goldens/ci/dark_theme/dashboard_loading.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+276 KB
...minders/test/feature_dashboard/view/goldens/ci/dark_theme/dashboard_success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+68.7 KB
...eminders/test/feature_dashboard/view/goldens/ci/light_theme/dashboard_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+83 KB
...eminders/test/feature_dashboard/view/goldens/ci/light_theme/dashboard_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+68.6 KB
...inders/test/feature_dashboard/view/goldens/ci/light_theme/dashboard_loading.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+283 KB
...inders/test/feature_dashboard/view/goldens/ci/light_theme/dashboard_success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+72 KB
...es/reminders/test/feature_dashboard/view/goldens/dark_theme/dashboard_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+89.8 KB
...es/reminders/test/feature_dashboard/view/goldens/dark_theme/dashboard_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+72.6 KB
.../reminders/test/feature_dashboard/view/goldens/dark_theme/dashboard_loading.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+301 KB
.../reminders/test/feature_dashboard/view/goldens/dark_theme/dashboard_success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+72.3 KB
...s/reminders/test/feature_dashboard/view/goldens/light_theme/dashboard_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+90.3 KB
...s/reminders/test/feature_dashboard/view/goldens/light_theme/dashboard_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+73 KB
...reminders/test/feature_dashboard/view/goldens/light_theme/dashboard_loading.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+306 KB
...reminders/test/feature_dashboard/view/goldens/light_theme/dashboard_success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions
50
examples/reminders/test/feature_reminder_list/factory/reminder_list_factory.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_rx_bloc/flutter_rx_bloc.dart'; | ||
import 'package:provider/provider.dart'; | ||
import 'package:reminders/base/common_blocs/coordinator_bloc.dart'; | ||
import 'package:reminders/base/common_blocs/firebase_bloc.dart'; | ||
import 'package:reminders/base/models/reminder/reminder_model.dart'; | ||
import 'package:reminders/base/services/reminders_service.dart'; | ||
import 'package:reminders/feature_reminder_list/blocs/reminder_list_bloc.dart'; | ||
import 'package:reminders/feature_reminder_list/services/reminder_list_service.dart'; | ||
import 'package:reminders/feature_reminder_list/views/reminder_list_page.dart'; | ||
import 'package:reminders/feature_reminder_manage/blocs/reminder_manage_bloc.dart'; | ||
import 'package:rx_bloc_list/models.dart'; | ||
|
||
import '../../mocks/bloc_mocks.dart'; | ||
import '../../mocks/coordinator_mock.dart'; | ||
import '../../mocks/reminder_manage_mock.dart'; | ||
import '../../mocks/service_mocks.dart'; | ||
import '../mock/reminder_list_mock.dart'; | ||
|
||
Widget reminderListFactory({ | ||
bool? isLoading, | ||
String? errors, | ||
PaginatedList<ReminderModel>? paginatedList, | ||
}) => | ||
Scaffold( | ||
body: MultiProvider(providers: [ | ||
Provider<RemindersService>( | ||
create: (context) => createRemindersServiceMock(), | ||
), | ||
Provider<ReminderListService>( | ||
create: (context) => createReminderListServiceMock(), | ||
), | ||
RxBlocProvider<CoordinatorBlocType>.value( | ||
value: coordinatorMockFactory(), | ||
), | ||
RxBlocProvider<ReminderListBlocType>.value( | ||
value: reminderListMockFactory( | ||
isLoading: isLoading, | ||
errors: errors, | ||
paginatedList: paginatedList, | ||
), | ||
), | ||
RxBlocProvider<FirebaseBlocType>.value( | ||
value: createFirebaseBlocMock(), | ||
), | ||
RxBlocProvider<ReminderManageBlocType>.value( | ||
value: reminderManageMockFactory(), | ||
), | ||
], child: const ReminderListPage()), | ||
); |
Oops, something went wrong.