New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: fixing for Flutter 3.13.0 #51
Conversation
class _MockMaterialPageRoute extends MaterialPageRoute<void> { | ||
_MockMaterialPageRoute({required super.builder}); | ||
|
||
void hackOverlays() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
I spent a good few minutes investigating what could have caused my test to fail after updating to Flutter 3.13.0.
I noticed that without using mockingjay, everything worked as expected (just like in version 3.10.0).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I create an issue about this, also: #52
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the issue @felipecastrosales !!!
_MockMaterialPageRoute({required super.builder}); | ||
|
||
void hackOverlays() { | ||
for (var i = 0; i < overlayEntries.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to test this method specifically? I feel it's now accidentally covered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel we don't need any additional tests, since before the change, no test were passing in flutter 3.13
Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
Description
It seems that the navigator in Flutter 3.13.0 has changed a little bit how it works internally, those changes broke Mockinjay because how it "hooks" mocks in the navigation made that some internal fields were not populated, breaking the tests when the mocked navigator was disposed.
This PR adds an addition hack in order to trick those unpopulated internal fields so it can start working again.
Type of Change
Fixes #52