File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
test/cypress/tests/modules/BlockEvents Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -249,6 +249,13 @@ export default class BlockEvents extends Module {
249
249
return ;
250
250
}
251
251
252
+ /**
253
+ * The Toolbox will be opened with immediate focus on the Search input,
254
+ * and '/' will be added in the search input by default — we need to prevent it and add '/' manually
255
+ */
256
+ event . preventDefault ( ) ;
257
+ this . Editor . Caret . insertContentAtCaretPosition ( '/' ) ;
258
+
252
259
this . activateToolbox ( ) ;
253
260
}
254
261
Original file line number Diff line number Diff line change 1
1
describe ( 'Slash keydown' , function ( ) {
2
2
describe ( 'pressed in empty block' , function ( ) {
3
- it ( 'should open Toolbox' , ( ) => {
3
+ it ( 'should add "/" in a block and open Toolbox' , ( ) => {
4
4
cy . createEditor ( {
5
5
data : {
6
6
blocks : [
@@ -19,6 +19,14 @@ describe('Slash keydown', function () {
19
19
. click ( )
20
20
. type ( '/' ) ;
21
21
22
+ /**
23
+ * Block content should contain slash
24
+ */
25
+ cy . get ( '[data-cy=editorjs]' )
26
+ . find ( '.ce-paragraph' )
27
+ . invoke ( 'text' )
28
+ . should ( 'eq' , '/' ) ;
29
+
22
30
cy . get ( '[data-cy="toolbox"] .ce-popover__container' )
23
31
. should ( 'be.visible' ) ;
24
32
} ) ;
You can’t perform that action at this time.
0 commit comments