Skip to content

Commit

Permalink
fixup! TF-3236 Widget test RichTextBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
tddang-linagora committed Nov 13, 2024
1 parent dcc0e00 commit 29f7345
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions core/test/presentation/views/text/rich_text_builder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,34 @@ void main() {
findNormalStyledText(textOrigin),
findsOneWidget,
);
expect(findFocusedHighlightStyledText(''), findsNothing);
expect(findUnfocusedHighlightStyledText(''), findsNothing);
});

testWidgets(
'should not highlight any text '
'when textOrigin is empty '
'and preMarkedText is null',
(tester) async {
// arrange
const wordToStyle = 'This is a test';
final richText = buildRichText(
textOrigin: '',
wordToStyle: wordToStyle,
);

// act
await tester.pumpWidget(richText);

// assert
expect(
findNormalStyledText(''),
findsOneWidget,
);
expect(findFocusedHighlightStyledText(wordToStyle), findsNothing);
expect(findUnfocusedHighlightStyledText(wordToStyle), findsNothing);
});

testWidgets(
'should highlight text with wordToStyle '
'when wordToStyle is not empty '
Expand Down

0 comments on commit 29f7345

Please sign in to comment.