Skip to content

Commit 19e83b5

Browse files
committed
content test: Use mergedStyleOf for mentions, too
This change isn't quite NFC: textStyleFromWidget will now match even if the Text widget has additional text in it beyond the targeted span. That seems fine, though: it's not likely to happen; and if for some reason it does, that's not really what this test is about.
1 parent 3c5915b commit 19e83b5

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

test/widgets/content_test.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -683,11 +683,8 @@ void main() {
683683
}
684684

685685
TextStyle textStyleFromWidget(WidgetTester tester, UserMention widget, String mentionText) {
686-
final fullNameSpan = tester.renderObject<RenderParagraph>(
687-
find.descendant(
688-
of: find.byWidget(widget), matching: find.text(mentionText))
689-
).text;
690-
return mergedStyleOfSubstring(fullNameSpan, mentionText)!;
686+
return mergedStyleOf(tester,
687+
findAncestor: find.byWidget(widget), mentionText)!;
691688
}
692689

693690
testWidgets('maintains font-size ratio with surrounding text', (tester) async {

0 commit comments

Comments
 (0)