mirror of
https://github.com/codex-team/editor.js
synced 2026-03-18 00:19:53 +01:00
* Imporove caret.isAtStart
* use selection to simplify caret at start/end check
* caret util and tests
* lint
* eslint fix
* fix tests
* patch version, changelog
* fix navigation out of delimiter
* arrow left tests
* left/right arrow tests
* chore: Fix typo in comment for block navigation
* lint fix
* resolve some ts errors in strict mode
* Revert "resolve some ts errors in strict mode"
This reverts commit 3252ac679f.
* ts errors fix
* rename utils
21 lines
500 B
TypeScript
21 lines
500 B
TypeScript
import Chainable = Cypress.Chainable;
|
|
import type EditorJS from '../../../../types/index';
|
|
|
|
|
|
/**
|
|
* Creates Editor instance with list of Paragraph blocks of passed texts
|
|
*
|
|
* @param textBlocks - list of texts for Paragraph blocks
|
|
*/
|
|
export function createEditorWithTextBlocks(textBlocks: string[]): Chainable<EditorJS> {
|
|
return cy.createEditor({
|
|
data: {
|
|
blocks: textBlocks.map((text) => ({
|
|
type: 'paragraph',
|
|
data: {
|
|
text,
|
|
},
|
|
})),
|
|
},
|
|
});
|
|
}
|