boxchecker/test/widget_test.dart

25 lines
888 B
Dart
Raw Normal View History

2021-11-02 16:02:13 -04:00
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:boxchecker/box_checker.dart';
2021-11-02 16:02:13 -04:00
void main() {
2021-12-02 10:27:02 -05:00
testWidgets('swaping tabs', (WidgetTester tester) async {
2021-11-02 16:02:13 -04:00
// Build our app and trigger a frame.
2021-12-02 10:27:02 -05:00
await tester.pumpWidget(const BoxChecker());
2021-11-02 16:02:13 -04:00
// Verify that our counter starts at 0.
2021-12-02 10:27:02 -05:00
expect(find.text('test list'), findsOneWidget);
expect(find.text('test template'), findsNothing);
2021-11-02 16:02:13 -04:00
2021-12-02 10:27:02 -05:00
tester.tap(find.byIcon(Icons.list_alt));
2021-11-02 16:02:13 -04:00
});
}