chore: delete legacy test file

This commit is contained in:
Lucas.Xu 2022-08-13 15:57:24 +08:00
parent a6bba5a0f9
commit e508d7414c
2 changed files with 1 additions and 40 deletions

View File

@ -52,7 +52,7 @@ void main() async {
LogicalKeyboardKey.enter,
);
lines += 1;
await tester.pumpAndSettle(const Duration(microseconds: 500));
expect(editor.documentLength, lines);
expect(editor.documentSelection,
Selection.collapsed(Position(path: [lines - 1], offset: 0)));

View File

@ -1,39 +0,0 @@
import 'dart:convert';
import 'dart:io';
import 'package:flowy_editor/flowy_editor.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import '../infra/test_raw_key_event.dart';
void main() async {
final file = File('test_assets/example.json');
final json = jsonDecode(await file.readAsString());
print(json);
setUpAll(() {
TestWidgetsFlutterBinding.ensureInitialized();
});
testWidgets('init FlowyEditor ', (tester) async {
final editorState = EditorState(
document: StateTree.fromJson(json),
);
final flowyEditor = FlowyEditor(editorState: editorState);
await tester.pumpWidget(MaterialApp(
home: flowyEditor,
));
editorState.service.selectionService
.updateSelection(Selection.collapsed(Position(path: [0], offset: 1)));
await tester.pumpAndSettle();
final key = const TestRawKeyEventData(
logicalKey: LogicalKeyboardKey.enter,
physicalKey: PhysicalKeyboardKey.enter,
).toKeyEvent;
editorState.service.keyboardService!.onKey(key);
await tester.pumpAndSettle();
expect(editorState.document.root.children.length, 2);
});
}