diff --git a/integration_test/scenarios/search/search_snippets_with_html_escape_scenario.dart b/integration_test/scenarios/search/search_snippets_with_html_escape_scenario.dart new file mode 100644 index 000000000..b7ddb78a7 --- /dev/null +++ b/integration_test/scenarios/search/search_snippets_with_html_escape_scenario.dart @@ -0,0 +1,36 @@ +import 'package:flutter_test/flutter_test.dart'; + +import '../../base/base_test_scenario.dart'; +import '../../models/provisioning_email.dart'; +import '../../robots/search_robot.dart'; +import '../../robots/thread_robot.dart'; + +class SearchSnippetsWithHtmlEscapeScenario extends BaseTestScenario { + SearchSnippetsWithHtmlEscapeScenario(super.$); + + @override + Future runTestLogic() async { + const email = String.fromEnvironment('BASIC_AUTH_EMAIL'); + const subject = ''; + + final threadRobot = ThreadRobot($); + final searchRobot = SearchRobot($); + + await provisionEmail( + [ProvisioningEmail(toEmail: email, subject: subject, content: subject)], + requestReadReceipt: false, + ); + await $.pumpAndSettle(); + + await threadRobot.tapOnSearchField(); + await searchRobot.enterKeyword(subject); + await searchRobot.tapOnShowAllResultsText(); + await $.pumpAndSettle(); + + await _expectEmailWithSubjectUnescapedVisible(subject); + } + + Future _expectEmailWithSubjectUnescapedVisible(String subject) async { + await expectViewVisible($(find.text(subject))); + } +} diff --git a/integration_test/tests/search/search_snippets_with_html_escape_test.dart b/integration_test/tests/search/search_snippets_with_html_escape_test.dart new file mode 100644 index 000000000..29e382745 --- /dev/null +++ b/integration_test/tests/search/search_snippets_with_html_escape_test.dart @@ -0,0 +1,9 @@ +import '../../base/test_base.dart'; +import '../../scenarios/search/search_snippets_with_html_escape_scenario.dart'; + +void main() { + TestBase().runPatrolTest( + description: 'Should see email with subject escaped when search email successfully', + scenarioBuilder: ($) => SearchSnippetsWithHtmlEscapeScenario($), + ); +} \ No newline at end of file