Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
test: coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
RuiMiguel committed Nov 29, 2023
1 parent 1e4a37d commit 89cbea8
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 176 deletions.
8 changes: 0 additions & 8 deletions lib/home/bloc/home_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class HomeBloc extends Bloc<HomeEvent, HomeState> {
on<Results>(_onResults);
on<SeeSourceAnswersRequested>(_onSeeSourceAnswersRequested);
on<SeeResultsSourceAnswers>(_onSeeSourceAnswers);
on<BackToAnswerRequested>(_onBackToAnswerRequested);
}

final QuestionsRepository _questionsRepository;
Expand Down Expand Up @@ -74,11 +73,4 @@ class HomeBloc extends Bloc<HomeEvent, HomeState> {
) {
emit(state.copyWith(status: Status.seeSourceAnswers));
}

void _onBackToAnswerRequested(
BackToAnswerRequested event,
Emitter<HomeState> emit,
) {
emit(state.copyWith(status: Status.sourceAnswersBackToResults));
}
}
4 changes: 0 additions & 4 deletions lib/home/bloc/home_event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,3 @@ class SeeSourceAnswersRequested extends HomeEvent {
class SeeResultsSourceAnswers extends HomeEvent {
const SeeResultsSourceAnswers();
}

class BackToAnswerRequested extends HomeEvent {
const BackToAnswerRequested();
}
64 changes: 0 additions & 64 deletions lib/home/widgets/see_source_answers.dart

This file was deleted.

1 change: 0 additions & 1 deletion lib/home/widgets/widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export 'logo.dart';
export 'question_view.dart';
export 'results_view.dart';
export 'search_box.dart';
export 'see_source_answers.dart';
export 'sources_carousel_view.dart';
export 'thinking_view.dart';
export 'transition_screen_mixin.dart';
Expand Down
22 changes: 22 additions & 0 deletions test/home/bloc/home_bloc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ void main() {
);
});

group('Results', () {
blocTest<HomeBloc, HomeState>(
'emits Status.results',
build: buildBloc,
act: (bloc) => bloc.add(Results()),
expect: () => [
HomeState(status: Status.results),
],
);
});

group('SeeSourceAnswersRequested', () {
blocTest<HomeBloc, HomeState>(
'emits Status.seeSourceAnswers',
Expand All @@ -90,5 +101,16 @@ void main() {
],
);
});

group('SeeResultsSourceAnswers', () {
blocTest<HomeBloc, HomeState>(
'emits Status.seeSourceAnswers',
build: buildBloc,
act: (bloc) => bloc.add(SeeResultsSourceAnswers()),
expect: () => [
HomeState(status: Status.seeSourceAnswers),
],
);
});
});
}
99 changes: 0 additions & 99 deletions test/home/widgets/see_source_answers_test.dart

This file was deleted.

0 comments on commit 89cbea8

Please sign in to comment.