Skip to content

Commit

Permalink
Started writing new unit test for deleteweekmodel, but it is not done…
Browse files Browse the repository at this point in the history
… yet
  • Loading branch information
Frederik Bendix committed Dec 6, 2023
1 parent b1c5530 commit 4ac416d
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions test/blocs/weekplans_bloc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ void main() {

test('Check deletion of a weekmodel from WeekModels',
async((DoneFn done) {

when(() => weekApi.get(
mockUser.id!, weekNameModel1.weekYear!, weekNameModel1.weekNumber!))
.thenAnswer(
Expand All @@ -272,16 +271,25 @@ void main() {
when(() => weekApi.getNames(mockUser.id!)).thenAnswer((_) =>
rx_dart.BehaviorSubject<List<WeekNameModel>>.seeded(weekNameModelList));

bloc.load(mockUser);

bloc.weekNameModels.listen((List<WeekNameModel>? response) {

bloc.weekModels.listen((List<WeekModel>? response) {
expect(response, isNull);
});

/*
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));
*/



bloc.load(mockUser);



done();

Expand All @@ -291,6 +299,8 @@ void main() {





test('Checks if the edit mode toggles from true', async((DoneFn done) {
/// Edit mode stream initial value is false.
bloc.toggleEditMode();
Expand Down

0 comments on commit 4ac416d

Please sign in to comment.