-
Notifications
You must be signed in to change notification settings - Fork 38
feat: capture navigation with transition animation #51
Conversation
setUpAll(() { | ||
registerFallbackValue(FakeRoute()); | ||
}); | ||
group('RouteGenerator', () { |
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.
In such case we would rather use mockingjay library that allows for mocking top-most Navigator. Would that work for you as well?
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.
Sure
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've tried using mockingjay, but this test is 'if navigator leads to correct page', so the only way to see that is to allow Navigator to do its job.
Mocking Navigator was not an option here.
I've tried to test it like a standalone class, but it the end its all context based, so needed to wrap it in widget.
As a result there are 2 ways out - i can see if the correct Page(widget) was rendered and ignore if Navigator was involved at all.
or
I can leave an observer as is and verify if it was called.
I like double checking so opt for leaving it as it is, but its ur call at the end
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
const SizedBox(height: 32), |
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.
const SizedBox(height: 32), | |
const SizedBox(height: AppSpacing.md), |
Let's update this in the future to use standardized spacings :)
Text( | ||
context.l10n.captureTitle, |
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.
Text( | |
context.l10n.captureTitle, | |
Text( | |
l10n.captureTitle, |
final l10n = context.l10n;
Just a nit, but we can extract the l10n similarly to theme
Description
Capture navigation with transition animation
Type of Change