mirror of
https://github.com/codex-team/editor.js
synced 2024-06-17 13:15:20 +02:00
6f36707f67
* Add tunes improvements * Allow to show Inline Toolbar at Block Tune Wrapper element * Add fake cursor on block selection * Fix lint * Update types * Fix bugs with selection * Remove selection observer * Update due to comments * Fix tests * Update docs/block-tunes.md Co-authored-by: Peter Savchenko <specc.dev@gmail.com> * Move fake cursor to selection utils * Fix missing range for Safari * Fix data attribute value * Add comment * Update z-index for inline-toolbar * Add changelog * Remove fake cursor visibility for the core Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
34 lines
795 B
TypeScript
34 lines
795 B
TypeScript
import * as _ from '../../../src/components/utils';
|
|
|
|
describe('Blocks selection', () => {
|
|
beforeEach(() => {
|
|
if (this && this.editorInstance) {
|
|
this.editorInstance.destroy();
|
|
} else {
|
|
cy.createEditor({}).as('editorInstance');
|
|
}
|
|
});
|
|
|
|
it('should remove block selection on click', () => {
|
|
cy.get('[data-cy=editorjs]')
|
|
.find('div.ce-block')
|
|
.click()
|
|
.type('First block{enter}');
|
|
|
|
cy.get('[data-cy=editorjs')
|
|
.find('div.ce-block')
|
|
.next()
|
|
.type('Second block')
|
|
.type('{movetostart}')
|
|
.trigger('keydown', {
|
|
shiftKey: true,
|
|
keyCode: _.keyCodes.UP,
|
|
});
|
|
|
|
cy.get('[data-cy=editorjs')
|
|
.click()
|
|
.find('div.ce-block')
|
|
.should('not.have.class', '.ce-block--selected');
|
|
});
|
|
});
|