@@ -65,57 +65,3 @@ it('should replace selected content with a new line', () => {
65
65
expect ( toPlainText ( before ) ) . toEqual ( initialText ) ;
66
66
expect ( toPlainText ( after ) ) . toEqual ( '\n' ) ;
67
67
} ) ;
68
-
69
- it ( 'should split the code block on CMD+ENTER' , ( ) => {
70
- const initialText = " const a = 'b';" ;
71
- const currentContent = ContentState . createFromText ( initialText ) ;
72
- const afterLastCharacter = SelectionState . createEmpty (
73
- currentContent
74
- . getBlockMap ( )
75
- . first ( )
76
- . getKey ( )
77
- )
78
- . set ( 'anchorOffset' , initialText . length )
79
- . set ( 'focusOffset' , initialText . length ) ;
80
- const before = EditorState . create ( {
81
- allowUndo : true ,
82
- currentContent,
83
- // Jump selection to the end of the line
84
- selection : afterLastCharacter
85
- } ) ;
86
- const after = handleReturn (
87
- {
88
- ctrlKey : true
89
- } ,
90
- before
91
- ) ;
92
-
93
- expect ( before . getCurrentContent ( ) . getBlockMap ( ) . size ) . toEqual ( 1 ) ;
94
- expect ( after . getCurrentContent ( ) . getBlockMap ( ) . size ) . toEqual ( 2 ) ;
95
- } ) ;
96
-
97
- it ( 'should split the code block even when the cursor is in the middle of the line' , ( ) => {
98
- const initialText = " const a = 'b';" ;
99
- const currentContent = ContentState . createFromText ( initialText ) ;
100
- const selectBeginningOfLine = SelectionState . createEmpty (
101
- currentContent
102
- . getBlockMap ( )
103
- . first ( )
104
- . getKey ( )
105
- ) ;
106
- const before = EditorState . create ( {
107
- allowUndo : true ,
108
- currentContent,
109
- // Jump selection to the end of the line
110
- selection : selectBeginningOfLine
111
- } ) ;
112
- const after = handleReturn (
113
- {
114
- ctrlKey : true
115
- } ,
116
- before
117
- ) ;
118
-
119
- expect ( before . getCurrentContent ( ) . getBlockMap ( ) . size ) . toEqual ( 1 ) ;
120
- expect ( after . getCurrentContent ( ) . getBlockMap ( ) . size ) . toEqual ( 2 ) ;
121
- } ) ;
0 commit comments