editor.js/test/cypress/tests/selection.spec.ts
Peter Savchenko 3272efc3f7
chore(linting): eslint updated, code linted (#2174)
* update eslint + autofix

* a bunch of eslint fixes

* some spelling & eslint fixes

* fix some eslint errors and spells

* Update __module.ts

* a bunch of eslint fixes in tests

* Update cypress.yml

* Update cypress.yml

* fix cypress docker image name

* fixes for tests

* more tests fixed

* rm rule ignore

* rm another ignored rule

* Update .eslintrc
2022-11-25 21:56:50 +04:00

36 lines
811 B
TypeScript

import * as _ from '../../../src/components/utils';
describe('Blocks selection', () => {
beforeEach(function () {
cy.createEditor({}).as('editorInstance');
});
afterEach(function () {
if (this.editorInstance) {
this.editorInstance.destroy();
}
});
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');
});
});