Skip to content

Commit

Permalink
test(app): fix FAQ text matching
Browse files Browse the repository at this point in the history
  • Loading branch information
tamara-slosarek authored and tamslo committed Feb 24, 2025
1 parent 5d90696 commit d42eff2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions app/integration_test/faq_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,25 @@ void main() {
expectedNumberOfQuestions,
);

Finder findExpandedQuestion(String answerText) => find.textContaining(
answerText.split('\n').first,
findRichText: true,
skipOffstage: false,
);

final BuildContext context =
tester.element(find.byType(Scaffold).first);
final firstQuestion = faqContent.first.questions.first(context);
expect(find.text(firstQuestion.question), findsOneWidget);
expect(find.text(firstQuestion.answer), findsNothing);
expect(findExpandedQuestion(firstQuestion.answer), findsNothing);

await tester.tap(find.byType(ExpansionTile).first);
await tester.pumpAndSettle();

expect(find.text(firstQuestion.answer), findsOneWidget);
expect(
findExpandedQuestion(firstQuestion.answer),
findsOneWidget,
);
},
);
});
Expand Down

0 comments on commit d42eff2

Please sign in to comment.