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 {
249249 return ;
250250 }
251251
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+
252259 this . activateToolbox ( ) ;
253260 }
254261
Original file line number Diff line number Diff line change 11describe ( 'Slash keydown' , function ( ) {
22 describe ( 'pressed in empty block' , function ( ) {
3- it ( 'should open Toolbox' , ( ) => {
3+ it ( 'should add "/" in a block and open Toolbox' , ( ) => {
44 cy . createEditor ( {
55 data : {
66 blocks : [
@@ -19,6 +19,14 @@ describe('Slash keydown', function () {
1919 . click ( )
2020 . type ( '/' ) ;
2121
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+
2230 cy . get ( '[data-cy="toolbox"] .ce-popover__container' )
2331 . should ( 'be.visible' ) ;
2432 } ) ;
You can’t perform that action at this time.
0 commit comments