editor.js/test/cypress/tests/selection.spec.ts
George Berezhnoy 6f36707f67
Tunes improvements for inline actions (#1722)
* 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>
2021-07-21 21:33:09 +03:00

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');
});
});