1
0
mirror of https://github.com/flutter/samples.git synced 2026-03-26 06:11:45 +00:00

[linting_tool] Add Adaptive Layout with Theming (#852)

This commit is contained in:
Abdullah Deshmukh
2021-07-14 03:01:14 +05:30
committed by GitHub
parent 35f1670098
commit 8e73c73f4b
25 changed files with 984 additions and 80 deletions

View File

@@ -5,26 +5,29 @@
// 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:linting_tool/main.dart';
import 'package:linting_tool/app.dart';
import 'package:linting_tool/pages/default_lints_page.dart';
import 'package:linting_tool/pages/home_page.dart';
import 'package:linting_tool/pages/saved_lints_page.dart';
void main() {
testWidgets('Counter increments smoke test', (tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
testWidgets('NavigationRail smoke test', (tester) async {
await tester.pumpWidget(const LintingTool());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
expect(find.byType(SavedLintsPage), findsNothing);
await tester.tap(find.text('Saved Profiles'));
await tester.pumpAndSettle();
expect(find.byType(SavedLintsPage), findsOneWidget);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
expect(find.byType(DefaultLintsPage), findsNothing);
await tester.tap(find.text('Default Profiles'));
await tester.pumpAndSettle();
expect(find.byType(DefaultLintsPage), findsOneWidget);
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
expect(find.byType(HomePage), findsNothing);
await tester.tap(find.text('Home'));
await tester.pumpAndSettle();
expect(find.byType(HomePage), findsOneWidget);
});
}