Open ch-angelino opened 2 years ago
Hi @ch-angelino π Thanks for opening an issue!
Are you able to provide a link to a minimal reproduction sample? It would be much easier to help if I could clone a working reproduction sample and run/debug it locally, thanks! π
Hi @felangel π
Here you go: https://github.com/ch-angelino/Flutter-Mocktail-Bug-Demo-122
Just clone the repo then go flutter pub get
and flutter test
and the error should come up π€
Thanks for looking into this π
Hi @felangel π
Here you go: https://github.com/ch-angelino/Flutter-Mocktail-Bug-Demo-122
Just clone the repo then go
flutter pub get
andflutter test
and the error should come up π€Thanks for looking into this π
Thanks Iβll take a look tomorrow morning!
Hey @felangel, any update on this? TIA
Hi @ch-angelino is this still an issue? I'm really sorry I didn't have time to look and it fell off my radar :(
@felangel I just tested that repro repo on Mocktail 1.0.3 and Flutter 3.13.9 and the same error is still coming up:
% flutter test
00:05 +0 -1: Fail 1 [E]
No matching calls. All calls: [VERIFIED] StoreMock.dispatch(DispatchedA{}), [VERIFIED] StoreMock.dispatch(DispatchedB{})
(If you called `verify(...).called(0);`, please instead use `verifyNever(...);`.)
package:matcher fail
package:mocktail/src/mocktail.dart 728:7 _VerifyCall._checkWith
package:mocktail/src/mocktail.dart 519:18 _makeVerify.<fn>
test/middleware_test.dart 19:11 main.<fn>
Describe the bug When verifying that 2 actions have been dispatched from a redux store in a redux middleware one after the other, the verify function cannot distinguish the 2 actions, i.e. any of the 2 actions will match 2 calls instead of 1 each.
To Reproduce
lib/middleware.dart
:test/middleware_test.dart
:Steps to reproduce the behavior:
flutter test
Expected behavior Test passes.
Logs
Additional context Tested on Mocktail versions 0.2.0 and 0.3.0.
Commenting out any of the 2
verify
checks makes the test pass, so the checks both work on their own. Adding.called(2)
to any of the 2verify
checks and commenting out the other check makes the test pass, so it seems there is no distinction between the 2 different actions.