Skip to content

Commit

Permalink
Verify parent matching works
Browse files Browse the repository at this point in the history
  • Loading branch information
passsy committed Oct 16, 2023
1 parent a0c8c28 commit 5a3ce27
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/widgets/text_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,31 @@ void main() {
spotText('foo${obj}bar').existsOnce(); // WidgetSpan becomes whitespace
});
});

testWidgets('chain with parents', (tester) async {
await tester.pumpWidget(
_stage(
children: [
ColoredBox(
color: Colors.red,
child: Text('a'),
),
RotatedBox(
quarterTurns: 2,
child: Text('b'),
),
Text('a'),
Text('b'),
],
),
);

spot<ColoredBox>().spotText('a').existsOnce();
spot<RotatedBox>().spotText('b').existsOnce();

spot<ColoredBox>().spotText('b').doesNotExist();
spot<RotatedBox>().spotText('a').doesNotExist();
});
});

group('spotTextWhere', () {
Expand Down

0 comments on commit 5a3ce27

Please sign in to comment.