Skip to content

Commit be8ae55

Browse files
committed
FLUT-940227-[others]: Updated test folder
1 parent b31a68a commit be8ae55

File tree

2 files changed

+36
-15
lines changed

2 files changed

+36
-15
lines changed

lib/main.dart

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,7 @@ import 'package:flutter/material.dart';
22
import 'package:syncfusion_flutter_charts/charts.dart';
33

44
void main() {
5-
runApp(const MyApp());
6-
}
7-
8-
class MyApp extends StatelessWidget {
9-
const MyApp({super.key});
10-
11-
@override
12-
Widget build(BuildContext context) {
13-
return const MaterialApp(
14-
debugShowCheckedModeBanner: false,
15-
home: HeatMap(),
16-
);
17-
}
5+
runApp(const HeatMap());
186
}
197

208
class HeatMap extends StatefulWidget {
@@ -81,8 +69,11 @@ class HeatMapState extends State<HeatMap> {
8169

8270
@override
8371
Widget build(BuildContext context) {
84-
return Scaffold(
85-
body: _buildHeatmapChart(),
72+
return MaterialApp(
73+
debugShowCheckedModeBanner: false,
74+
home: Scaffold(
75+
body: _buildHeatmapChart(),
76+
),
8677
);
8778
}
8879

test/widget_test.dart

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// This is a basic Flutter widget test.
2+
//
3+
// To perform an interaction with a widget in your test, use the WidgetTester
4+
// utility in the flutter_test package. For example, you can send tap and scroll
5+
// gestures. You can also use WidgetTester to find child widgets in the widget
6+
// tree, read text, and verify that the values of widget properties are correct.
7+
8+
import 'package:flutter/material.dart';
9+
import 'package:flutter_test/flutter_test.dart';
10+
11+
import 'package:heatmap/main.dart';
12+
13+
void main() {
14+
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15+
// Build our app and trigger a frame.
16+
await tester.pumpWidget(const HeatMap());
17+
18+
// Verify that our counter starts at 0.
19+
expect(find.text('0'), findsOneWidget);
20+
expect(find.text('1'), findsNothing);
21+
22+
// Tap the '+' icon and trigger a frame.
23+
await tester.tap(find.byIcon(Icons.add));
24+
await tester.pump();
25+
26+
// Verify that our counter has incremented.
27+
expect(find.text('0'), findsNothing);
28+
expect(find.text('1'), findsOneWidget);
29+
});
30+
}

0 commit comments

Comments
 (0)