Skip to content

Commit 66ae481

Browse files
committed
Fix tests
1 parent 5d3b5fe commit 66ae481

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/ui/annotated_text_test.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ void main() {
1616
),
1717
);
1818

19-
// Get the only RichText widget in the tree
20-
final richTextWidget = tester.widget<RichText>(find.byType(RichText));
21-
final rootSpan = richTextWidget.text as TextSpan;
19+
// Get the Text widget that uses Text.rich
20+
final textWidget = tester.widget<Text>(find.byType(Text));
21+
final rootSpan = textWidget.textSpan! as TextSpan;
2222

2323
// Combine all spans into a single string
2424
final fullText = rootSpan.children!.map((span) => (span as TextSpan).text).join();
@@ -42,8 +42,8 @@ void main() {
4242
),
4343
);
4444

45-
final richText = tester.widget<RichText>(find.byType(RichText));
46-
final rootSpan = richText.text as TextSpan;
45+
final textWidget = tester.widget<Text>(find.byType(Text));
46+
final rootSpan = textWidget.textSpan! as TextSpan;
4747

4848
final annotatedSpan = rootSpan.children![1]; // "world"
4949
expect((annotatedSpan as TextSpan).style!.color, equals(annotationStyle.color));
@@ -61,9 +61,9 @@ void main() {
6161
),
6262
);
6363

64-
// Get the RichText widget
65-
final richTextWidget = tester.widget<RichText>(find.byType(RichText));
66-
final rootSpan = richTextWidget.text as TextSpan;
64+
// Get the Text widget that uses Text.rich
65+
final textWidget = tester.widget<Text>(find.byType(Text));
66+
final rootSpan = textWidget.textSpan! as TextSpan;
6767

6868
// Locate the annotated span (second span in the children list)
6969
final annotatedSpan = rootSpan.children![1] as TextSpan;

0 commit comments

Comments
 (0)