mirror of
https://github.com/codex-team/editor.js
synced 2024-06-09 01:12:28 +02:00
fix changelog (#2704)
This commit is contained in:
parent
238c909016
commit
8276daa5ca
|
@ -249,6 +249,13 @@ export default class BlockEvents extends Module {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Toolbox will be opened with immediate focus on the Search input,
|
||||||
|
* and '/' will be added in the search input by default — we need to prevent it and add '/' manually
|
||||||
|
*/
|
||||||
|
event.preventDefault();
|
||||||
|
this.Editor.Caret.insertContentAtCaretPosition('/');
|
||||||
|
|
||||||
this.activateToolbox();
|
this.activateToolbox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
describe('Slash keydown', function () {
|
describe('Slash keydown', function () {
|
||||||
describe('pressed in empty block', function () {
|
describe('pressed in empty block', function () {
|
||||||
it('should open Toolbox', () => {
|
it('should add "/" in a block and open Toolbox', () => {
|
||||||
cy.createEditor({
|
cy.createEditor({
|
||||||
data: {
|
data: {
|
||||||
blocks: [
|
blocks: [
|
||||||
|
@ -19,6 +19,14 @@ describe('Slash keydown', function () {
|
||||||
.click()
|
.click()
|
||||||
.type('/');
|
.type('/');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Block content should contain slash
|
||||||
|
*/
|
||||||
|
cy.get('[data-cy=editorjs]')
|
||||||
|
.find('.ce-paragraph')
|
||||||
|
.invoke('text')
|
||||||
|
.should('eq', '/');
|
||||||
|
|
||||||
cy.get('[data-cy="toolbox"] .ce-popover__container')
|
cy.get('[data-cy="toolbox"] .ce-popover__container')
|
||||||
.should('be.visible');
|
.should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue