Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
I should probably stop committing directly to master. I never learn.
*Puts on cone of shame*
  • Loading branch information
IoanaAlexandru committed Oct 7, 2020
1 parent 0700967 commit 1b92b95
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/authentication_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ void main() {
.thenAnswer((realInvocation) => Future.value(true));
when(mockWebsiteProvider.fetchWebsites(any))
.thenAnswer((_) => Future.value([]));
when(mockWebsiteProvider.fetchFavouriteWebsites())
.thenAnswer((_) => Future.value(null));

mockFilterProvider = MockFilterProvider();
// ignore: invalid_use_of_protected_member
Expand Down
2 changes: 2 additions & 0 deletions test/integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ void main() {
isPrivate: false,
),
]));
when(mockWebsiteProvider.fetchFavouriteWebsites()).thenAnswer(
(_) async => (await mockWebsiteProvider.fetchWebsites(any)).take(3));

mockFilterProvider = MockFilterProvider();
// ignore: invalid_use_of_protected_member
Expand Down
2 changes: 2 additions & 0 deletions test/portal_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ void main() {
isPrivate: false,
),
]));
when(mockWebsiteProvider.fetchFavouriteWebsites()).thenAnswer(
(_) async => (await mockWebsiteProvider.fetchWebsites(any)).take(3));

final FilterProvider mockFilterProvider = MockFilterProvider();
// ignore: invalid_use_of_protected_member
Expand Down
4 changes: 3 additions & 1 deletion test/settings_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import 'package:acs_upb_mobile/pages/faq/service/question_provider.dart';
import 'package:acs_upb_mobile/pages/news_feed/model/news_feed_item.dart';
import 'package:acs_upb_mobile/pages/news_feed/service/news_provider.dart';
import 'package:acs_upb_mobile/pages/portal/service/website_provider.dart';
import 'package:acs_upb_mobile/resources/locale_provider.dart';
import 'package:acs_upb_mobile/pages/settings/service/request_provider.dart';
import 'package:acs_upb_mobile/pages/settings/view/request_permissions.dart';
import 'package:acs_upb_mobile/pages/settings/view/settings_page.dart';
import 'package:acs_upb_mobile/resources/locale_provider.dart';
import 'package:acs_upb_mobile/widgets/dialog.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
Expand Down Expand Up @@ -65,6 +65,8 @@ void main() {
.thenAnswer((realInvocation) => Future.value(true));
when(mockWebsiteProvider.fetchWebsites(any))
.thenAnswer((_) => Future.value([]));
when(mockWebsiteProvider.fetchFavouriteWebsites())
.thenAnswer((_) => Future.value(null));

mockQuestionProvider = MockQuestionProvider();
// ignore: invalid_use_of_protected_member
Expand Down

0 comments on commit 1b92b95

Please sign in to comment.