chore: remove the selection_menu_widget_test.dart

This commit is contained in:
Lucas.Xu 2022-09-25 15:55:28 +08:00
parent 6bda1fd2ea
commit 62c2da06d4
2 changed files with 0 additions and 50 deletions

View File

@ -1,49 +0,0 @@
import 'package:appflowy_editor/src/render/selection_menu/selection_menu_item_widget.dart';
import 'package:appflowy_editor/src/render/selection_menu/selection_menu_service.dart';
import 'package:appflowy_editor/src/render/selection_menu/selection_menu_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import '../../infra/test_editor.dart';
void main() async {
setUpAll(() {
TestWidgetsFlutterBinding.ensureInitialized();
});
group('selection_menu_item_widget.dart', () {
testWidgets('test selection menu item widget', (tester) async {
bool flag = false;
final editorState = tester.editor.editorState;
final menuService = _TestSelectionMenuService();
const icon = Icon(Icons.abc);
final item = SelectionMenuItem(
name: 'example',
icon: icon,
keywords: ['example A', 'example B'],
handler: (editorState, menuService, context) {
flag = true;
},
);
final widget = SelectionMenuItemWidget(
editorState: editorState,
menuService: menuService,
item: item,
isSelected: true,
);
await tester.pumpWidget(MaterialApp(home: widget));
await tester.tap(find.byType(SelectionMenuItemWidget));
expect(flag, true);
});
});
}
class _TestSelectionMenuService implements SelectionMenuService {
@override
void dismiss() {}
@override
void show() {}
@override
Offset get topLeft => throw UnimplementedError();
}

View File

@ -1,5 +1,4 @@
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:appflowy_editor/src/document/built_in_attribute_keys.dart';
import 'package:appflowy_editor/src/render/selection_menu/selection_menu_item_widget.dart';
import 'package:appflowy_editor/src/render/selection_menu/selection_menu_service.dart';
import 'package:appflowy_editor/src/render/selection_menu/selection_menu_widget.dart';