mirror of
https://github.com/codex-team/editor.js
synced 2024-06-22 23:46:37 +02:00
* deps: upgrade cypress and related libraries * chore: automate migrate cypress config, rename spec files * fix: custom commands types * chore: upgrade CHANGELOG.md * ci: upgrade cypress action to support new config file format * ci: remove container from firefox job, upgrade checkout action
36 lines
811 B
TypeScript
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');
|
|
});
|
|
});
|