fix(widget-markdown): properly check for selection when inserting links (#4075)

This commit is contained in:
Erez Rokah
2020-07-27 18:02:42 +02:00
committed by GitHub
parent 04ccb56e66
commit a4b7481a99
3 changed files with 90 additions and 5 deletions

View File

@ -268,6 +268,7 @@ Cypress.Commands.add('insertEditorComponent', title => {
['clickCodeButton', 'Code'],
['clickItalicButton', 'Italic'],
['clickQuoteButton', 'Quote'],
['clickLinkButton', 'Link'],
].forEach(([commandName, toolbarButtonName]) => {
Cypress.Commands.add(commandName, opts => {
return cy.clickToolbarButton(toolbarButtonName, opts);
@ -316,6 +317,12 @@ Cypress.Commands.add('clearMarkdownEditorContent', () => {
.backspace({ times: 2 });
});
Cypress.Commands.add('confirmRawEditorContent', expectedDomString => {
cy.get('.cms-editor-raw').within(() => {
cy.contains('span', expectedDomString);
});
});
function toPlainTree(domString) {
return rehype()
.use(removeSlateArtifacts)