halkyon/halkyon_learn_flutter/test/widget_test.dart

31 lines
1.1 KiB
Dart
Raw Normal View History

import 'dart:ui' show Size;
import 'package:flutter_test/flutter_test.dart';
import 'package:halkyon_learn_flutter/main.dart';
import 'package:halkyon_learn_flutter/src/core/dependencies/dependencies_scope.dart';
import 'package:halkyon_learn_flutter/src/core/editor/rich_content_editor.dart';
import 'package:halkyon_learn_flutter/src/core/editor/rich_content_view.dart';
import 'support/test_dependencies.dart';
void main() {
testWidgets('signs in and shows the editor playground', (tester) async {
tester.view.physicalSize = const Size(1200, 1600);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
await tester.pumpWidget(
DependenciesScope(
dependencies: testDependencies(),
child: const HalkyonLearnApp(),
),
);
// Signs in, then flushes the editor's timers.
await tester.pump();
await tester.pump(const Duration(seconds: 1));
expect(find.text('Halkyon Learn'), findsOneWidget);
expect(find.byType(RichContentEditor), findsOneWidget);
expect(find.byType(RichContentView), findsOneWidget);
});
}