From d42eff237ac7d194ddabf8975f581d3bde88dc32 Mon Sep 17 00:00:00 2001 From: tamara-slosarek Date: Mon, 24 Feb 2025 16:00:02 +0100 Subject: [PATCH] test(app): fix FAQ text matching --- app/integration_test/faq_test.dart | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/integration_test/faq_test.dart b/app/integration_test/faq_test.dart index 3fcb5d14..246fdd97 100644 --- a/app/integration_test/faq_test.dart +++ b/app/integration_test/faq_test.dart @@ -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, + ); }, ); });