1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00
Files
samples/provider_shopper/test/widget_test.dart
Brett Morgan e2e2713986 Enforce use_key_in_widget_constructors and file_names lints (#913)
* Start enforcing use_key_in_widget_constructors and file_names lints

* dart format

* analysis fixes

* analysis fixes, pt2

* analysis fixes, part 3

* Revert platform_design (test failure)

* More reverts

* Notate why we aren't enforcing a lint
2021-10-08 14:30:28 -07:00

34 lines
1.1 KiB
Dart

// Copyright 2019 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:provider_shopper/main.dart';
void main() {
testWidgets('smoke test', (tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
// Navigating through login page.
await tester.tap(find.text('ENTER'));
await tester.pumpAndSettle();
// Check that shopping cart is empty at start.
await tester.tap(find.byIcon(Icons.shopping_cart));
await tester.pumpAndSettle();
expect(find.text('\$0'), findsOneWidget);
// Buy an item.
await tester.pageBack();
await tester.pumpAndSettle();
await tester.tap(find.text('ADD').first);
// Check that the shopping cart is not empty anymore.
await tester.tap(find.byIcon(Icons.shopping_cart));
await tester.pumpAndSettle();
expect(find.text('\$0'), findsNothing);
});
}