Skip to content

Commit

Permalink
Fixed test not being correctly merged
Browse files Browse the repository at this point in the history
  • Loading branch information
BicaniWolfie committed Dec 6, 2023
1 parent 0a5b156 commit 1dec9b5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/blocs/weekplans_bloc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,30 @@ void main() {
.thenAnswer((_) => rx_dart.BehaviorSubject<bool>.seeded(true));

test('Should be able to load weekplans for a user', async((DoneFn done) {
//Checks if the loaded weekNameModels are not null and are equal to the
when(() => weekApi.get(
mockUser.id!, weekNameModel1.weekYear!, weekNameModel1.weekNumber!))
.thenAnswer(
(_) => rx_dart.BehaviorSubject<WeekModel>.seeded(weekModel1));

when(() => weekApi.getNames(mockUser.id!)).thenAnswer((_) =>
rx_dart.BehaviorSubject<List<WeekNameModel>>.seeded(weekNameModelList));

// Checks if the loaded weekNameModels are not null and are equal to the
// expected weekName model list
bloc.weekNameModels.listen((List<WeekNameModel>? response) {
expect(response, isNotNull);
expect(response, equals(weekNameModelList));
});

// Checks if the response of oldWeekModels are not null and are equal to the
// expected weekmodelList
bloc.oldWeekModels.listen((List<WeekModel> response) {
expect(response, isNotNull);
expect(response, equals(weekModelList));
done();
});
//Loads the mockUser with the WeekNameModel and OldWeekModels. This should

// Loads the mockUser with the WeekNameModel and OldWeekModels. This should
// trigger the listeners
bloc.load(mockUser);
}));
Expand Down

0 comments on commit 1dec9b5

Please sign in to comment.