Skip to content

Commit

Permalink
fix: pr comments #1
Browse files Browse the repository at this point in the history
  • Loading branch information
MhouneyLH committed Sep 1, 2023
1 parent 9b2a4af commit f1644de
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/features/presentation/bloc/desk/desk_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class DeskBloc extends Bloc<DeskEvent, DeskState> {
final CreateDeskUsecase createDeskUsecase;
final GetAllDesksUsecase getAllDesksUsecase;
final GetDeskByIdUsecase getDeskByIdUsecase;
final DeleteDeskUsecase deleteDeskUsecase;
final UpdateDeskUsecase updateDeskUsecase;
final DeleteDeskUsecase deleteDeskUsecase;

DeskBloc({
required this.createDeskUsecase,
Expand Down
34 changes: 27 additions & 7 deletions test/features/presentation/pages/home_page/home_page_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,6 @@ void main() {
await widgetTester.pumpWidget(createWidgetUnderTest());
await widgetTester.pumpAndSettle();
// assert
expect(find.byKey(const Key('analytics-desk-card-standing')),
findsOneWidget);
expect(
find.byKey(const Key('analytics-desk-card-sitting')), findsOneWidget);

final InteractionCard analyticsDeskCardStanding =
widgetTester.firstWidget(
find.byKey(const Key('analytics-desk-card-standing')))
Expand All @@ -151,9 +146,17 @@ void main() {
.firstWidget(find.byKey(const Key('analytics-desk-card-sitting')))
as InteractionCard;

expect(find.byKey(const Key('analytics-desk-card-standing')),
findsOneWidget);
expect(
find.byKey(const Key('analytics-desk-card-sitting')), findsOneWidget);

expect(analyticsDeskCardStanding.child, isA<LinearProgressIndicator>());
expect(analyticsDeskCardSitting.child, isA<LinearProgressIndicator>());

expect(analyticsDeskCardStanding.subtitle, isNull);
expect(analyticsDeskCardSitting.subtitle, isNull);

expect(analyticsDeskCardStanding.iconAtEnd, isNull);
expect(analyticsDeskCardSitting.iconAtEnd, isNull);
});
Expand All @@ -177,8 +180,24 @@ void main() {
await widgetTester.pumpWidget(createWidgetUnderTest());
await widgetTester.pumpAndSettle();
// assert
final InteractionCard presetCard0 =
widgetTester.firstWidget(find.byKey(const Key('preset-desk-card-0')))
as InteractionCard;
final InteractionCard presetCard1 =
widgetTester.firstWidget(find.byKey(const Key('preset-desk-card-1')))
as InteractionCard;

expect(find.byKey(const Key('preset-desk-card-0')), findsOneWidget);
expect(find.byKey(const Key('preset-desk-card-1')), findsOneWidget);

expect(presetCard0.subtitle, isNotNull);
expect(presetCard1.subtitle, isNotNull);

expect(presetCard0.child, isNull);
expect(presetCard1.child, isNull);

expect(presetCard0.iconAtEnd, isNotNull);
expect(presetCard1.iconAtEnd, isNotNull);
});
});

Expand All @@ -201,11 +220,12 @@ void main() {
await widgetTester.pumpWidget(createWidgetUnderTest());
await widgetTester.pumpAndSettle();
// assert
expect(find.byKey(const Key('others-desk-card-move')), findsOneWidget);

final InteractionCard othersCardMove = widgetTester.firstWidget(
find.byKey(const Key('others-desk-card-move'))) as InteractionCard;

expect(find.byKey(const Key('others-desk-card-move')), findsOneWidget);

expect(othersCardMove.subtitle, isNull);
expect(othersCardMove.child, isNull);
expect(othersCardMove.iconAtEnd, isNull);
});
Expand Down

0 comments on commit f1644de

Please sign in to comment.