If we have a TextSpan
that is a child of a RichText
widget, how would you test the text content.
new TextSpan(
text: 'Hello world!',
style: new TextStyle(color: Colors.black),
)
In your tests, with a Text
widget, you can use expect(find.text('Hello world!'), findsOneWidget)
, but this doesn't work if you have a TextSpan
.
expect(find.byType(TextSpan), findsOneWidget)
also does not find any widgets of type TextSpan
.