Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
cometics on cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed Dec 29, 2021
1 parent b0dc448 commit e65bd94
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions cypress/integration/27-block-slate-paste-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,30 @@ describe('Block Tests: external text containing html contents/tags ', () => {

cy.get('[id="page-document"] p:nth-child(3)').should('have.length', 1);
});

it('should paste external formatted text and does not split the blocks', function () {
cy.getSlateEditorAndType('Let"s paste external html texts');
cy.wait(1000);
cy.setSlateCursor('texts').type('{enter}');
// The idea is pasteClipboard should only apply on its attached slate block
// by not splitting them into blocks.
createSlateBlock().pasteClipboard(
`<p><strong>Lorem Ipsum</strong>
<p>
`<p><strong>Lorem Ipsum</strong>
is simply dummy text of the printing and typesetting industry.
</p>
</p>
`,
);

// Save
cy.toolbarSave();

cy.get('[id="page-document"] p:nth-child(2)')
cy.get('[id="page-document"] > p:nth-child(3)')
.children()
.its('length')
.should('be.gte', 1);
cy.get('[id="page-document"] p:nth-child(3)').should('have.length', 0);
cy.get('[id="page-document"] > p:nth-child(4)')
.children()
.should('have.length', 0);
});

it('should paste external text containing empty anchor links', function () {
cy.getSlateEditorAndType(
'Let"s paste external html texts with empty anchor links',
Expand Down

0 comments on commit e65bd94

Please sign in to comment.