Hi all,
I have a very simple tab bar
appBar: AppBar(
bottom: TabBar(
tabs: [
Tab(icon: Icon(Icons.toc)),
Tab(icon: Icon(Icons.school)),
Tab(icon: Icon(Icons.connect_without_contact)),
Tab(icon: Icon(Icons.mail_outline)),
],
),
title: Text('MyApp'),
)
and I want to test that each tab opens up the right view. I have tried all sorts but without luck
testWidgets('Click on lesson tab', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyAppTabHome());
var v = find.byType(Tab).at(1);
await tester.tap(v);
await tester.pump();
expect(find.text('L1'), findsOneWidget);
expect(find.text('L2'), findsOneWidget);
expect(find.text('L3'), findsOneWidget);
expect(find.text('L4'), findsOneWidget);
});
Am I doing it wrong?
Thanks
Fed