mirror of
				https://github.com/AppFlowy-IO/AppFlowy.git
				synced 2025-11-04 03:54:44 +00:00 
			
		
		
		
	* feat: Implement emoji shortcut event (#2038) * test: emoji shortcut integration test (#2038) * test: Fixed testcase for emoji_shortcut_test (#2038) * fix: remove _showEmojiPickerMenu (#4133) * fix: change local variables with underscore --------- Co-authored-by: jazima <jazim.a.29@gmail.com>
		
			
				
	
	
		
			42 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
import 'dart:io';
 | 
						|
import 'package:appflowy/workspace/presentation/settings/widgets/emoji_picker/emoji_picker.dart';
 | 
						|
import 'package:appflowy_editor/appflowy_editor.dart';
 | 
						|
import 'package:appflowy_editor/src/editor/editor_component/service/editor.dart';
 | 
						|
import 'package:flutter/services.dart';
 | 
						|
import 'package:flutter_test/flutter_test.dart';
 | 
						|
import 'package:integration_test/integration_test.dart';
 | 
						|
 | 
						|
import 'util/keyboard.dart';
 | 
						|
import 'util/util.dart';
 | 
						|
 | 
						|
void main() {
 | 
						|
  IntegrationTestWidgetsFlutterBinding.ensureInitialized();
 | 
						|
  // May be better to move this to an existing test but unsure what it fits with
 | 
						|
  group('Keyboard shortcuts related to emojis', () {
 | 
						|
    testWidgets('cmd/ctrl+alt+e shortcut opens the emoji picker',
 | 
						|
        (tester) async {
 | 
						|
      await tester.initializeAppFlowy();
 | 
						|
      await tester.tapGoButton();
 | 
						|
      
 | 
						|
      final Finder editor = find.byType(AppFlowyEditor);
 | 
						|
      await tester.tap(editor);
 | 
						|
      await tester.pumpAndSettle();
 | 
						|
 | 
						|
      expect(find.byType(EmojiSelectionMenu), findsNothing);
 | 
						|
 | 
						|
      await FlowyTestKeyboard.simulateKeyDownEvent(
 | 
						|
        [
 | 
						|
          Platform.isMacOS
 | 
						|
              ? LogicalKeyboardKey.meta
 | 
						|
              : LogicalKeyboardKey.control,
 | 
						|
          LogicalKeyboardKey.alt,
 | 
						|
          LogicalKeyboardKey.keyE,
 | 
						|
        ],
 | 
						|
        tester: tester,
 | 
						|
      );
 | 
						|
 | 
						|
      expect(find.byType(EmojiSelectionMenu), findsOneWidget);
 | 
						|
    });
 | 
						|
  });
 | 
						|
}
 |