mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: delete legacy test file
This commit is contained in:
parent
a6bba5a0f9
commit
e508d7414c
@ -52,7 +52,7 @@ void main() async {
|
|||||||
LogicalKeyboardKey.enter,
|
LogicalKeyboardKey.enter,
|
||||||
);
|
);
|
||||||
lines += 1;
|
lines += 1;
|
||||||
|
await tester.pumpAndSettle(const Duration(microseconds: 500));
|
||||||
expect(editor.documentLength, lines);
|
expect(editor.documentLength, lines);
|
||||||
expect(editor.documentSelection,
|
expect(editor.documentSelection,
|
||||||
Selection.collapsed(Position(path: [lines - 1], offset: 0)));
|
Selection.collapsed(Position(path: [lines - 1], offset: 0)));
|
||||||
|
@ -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);
|
|
||||||
});
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user