Skip to content

Commit 24dc091

Browse files
committed
feat: Making normal setup test. #1
1 parent c5952a7 commit 24dc091

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

lib/home_page.dart

+5-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ class HomePageState extends State<HomePage> {
282282
// You can also upload the picked image to any server (eg : AWS s3
283283
// or Firebase) and then return the uploaded image URL.
284284
Future<String> _onImagePickCallback(File file) async {
285-
//return "https://d3vhc53cl8e8km.cloudfront.net/artists/220/e16cb080-cb30-11ec-b991-0ee6b8365494.jpg";
285+
//return "https://pbs.twimg.com/media/EzmJ_YBVgAEnoF2?format=jpg&name=large";
286286
if (!kIsWeb) {
287287
// Copies the picked file from temporary cache to applications directory
288288
final appDocDir = await getApplicationDocumentsDirectory();
@@ -315,6 +315,10 @@ class HomePageState extends State<HomePage> {
315315
}
316316

317317
final file = File.fromRawPath(bytes);
318+
319+
// TODO maybe I don't need to call `onImagePickCallback` here.
320+
// Recheck the flow on mobile devices and then on the web, do not call `onImagePickCallback` here.
321+
// Let's try to use base64 or something
318322

319323
return onImagePickCallback(file);
320324
}

test/widget_test.dart

+4-11
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,13 @@ import 'package:flutter_test/flutter_test.dart';
1111
import 'package:app/main.dart';
1212

1313
void main() {
14-
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
14+
testWidgets('Normal setup', (WidgetTester tester) async {
1515
// Build our app and trigger a frame.
1616
await tester.pumpWidget(const App());
1717

18-
// Verify that our counter starts at 0.
19-
expect(find.text('0'), findsOneWidget);
20-
expect(find.text('1'), findsNothing);
18+
await tester.pumpAndSettle();
2119

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);
20+
// Expect to find the normal page setup
21+
expect(find.text('Flutter Quill'), findsOneWidget);
2922
});
3023
}

0 commit comments

Comments
 (0)