-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
eae6a3a
commit a524ab5
Showing
4 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import 'package:app/common/module.dart'; | ||
import 'package:app/faq/constants.dart'; | ||
import 'package:flutter_localizations/flutter_localizations.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
|
||
void main() { | ||
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.onlyPumps; | ||
|
||
group('integration test for the faq page', () { | ||
final appRouter = AppRouter(); | ||
final faqWidget = MaterialApp.router( | ||
debugShowCheckedModeBanner: false, | ||
routeInformationParser: appRouter.defaultRouteParser(), | ||
routerDelegate: appRouter.delegate( | ||
initialDeepLink: 'main/faq', | ||
), | ||
localizationsDelegates: [ | ||
AppLocalizations.delegate, | ||
GlobalMaterialLocalizations.delegate, | ||
GlobalWidgetsLocalizations.delegate, | ||
GlobalCupertinoLocalizations.delegate, | ||
], | ||
supportedLocales: [Locale('en', '')], | ||
); | ||
|
||
testWidgets('All questions are loaded and expansion tiles can be open', | ||
(tester) async { | ||
await tester.pumpWidget(faqWidget); | ||
await tester.pumpAndSettle(); | ||
|
||
expect( | ||
find | ||
.descendant( | ||
of: find.byKey(ValueKey('questions_column')), | ||
matching: find.byType(ExpansionTile), | ||
) | ||
.evaluate() | ||
.length, | ||
faqList.length, | ||
); | ||
|
||
expect(find.text(faqList[0].question), findsOneWidget); | ||
expect(find.text(faqList[0].answer), findsNothing); | ||
|
||
await tester.tap(find.byType(ExpansionTile).first); | ||
await tester.pumpAndSettle(); | ||
|
||
expect(find.text(faqList[0].answer), findsOneWidget); | ||
}); | ||
}); | ||
} |
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
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