-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
31 additions
and
35 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
import 'package:altme/app/app.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:mockingjay/mockingjay.dart'; | ||
|
||
import '../../../helpers/helpers.dart'; | ||
|
||
void main() { | ||
group('BackLeadingButton', () { | ||
testWidgets('pops when IconButton is tapped', (tester) async { | ||
final MockNavigator navigator = MockNavigator(); | ||
bool popTriggered = false; | ||
|
||
await tester.pumpApp( | ||
MockNavigatorProvider( | ||
navigator: navigator, | ||
child: const Material( | ||
child: BackLeadingButton(), | ||
), | ||
BackLeadingButton( | ||
onPressed: () { | ||
popTriggered = true; | ||
}, | ||
), | ||
); | ||
await tester.tap(find.byType(IconButton)); | ||
verify(navigator.pop).called(1); | ||
await tester.pump(); | ||
|
||
expect(popTriggered, isTrue); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters