testcase updated

This commit is contained in:
robonetphy 2023-04-01 18:35:08 +05:30
parent 5683a687ac
commit 8ce1a26060

View file

@ -56,11 +56,15 @@ describe('Drag and drop the block of Editor', function () {
});
it('should have block dragover style on the top of target block', function () {
cy.get('[data-cy=editorjs]').get('div.ce-block').first().click();
cy.get('[data-cy=editorjs]')
.get('div.ce-block')
.first()
.click();
const dataTransfer = new DataTransfer();
cy.get('.ce-toolbar__settings-btn').trigger('dragstart', { dataTransfer });
cy.get('.ce-toolbar__settings-btn')
.trigger('dragstart', { dataTransfer });
cy.get('[data-cy=editorjs]')
.get('div.ce-block')
@ -92,11 +96,15 @@ describe('Drag and drop the block of Editor', function () {
});
it('should have block dragover style on the bottom of target block', function () {
cy.get('[data-cy=editorjs]').get('div.ce-block').first().click();
cy.get('[data-cy=editorjs]')
.get('div.ce-block')
.first()
.click();
const dataTransfer = new DataTransfer();
cy.get('.ce-toolbar__settings-btn').trigger('dragstart', { dataTransfer });
cy.get('.ce-toolbar__settings-btn')
.trigger('dragstart', { dataTransfer });
cy.get('[data-cy=editorjs]')
.get('div.ce-block')
@ -128,10 +136,14 @@ describe('Drag and drop the block of Editor', function () {
});
it('should drag the first block and drop after the last block.', function () {
cy.get('[data-cy=editorjs]').get('div.ce-block').first().click();
cy.get('[data-cy=editorjs]')
.get('div.ce-block')
.first()
.click();
const dataTransfer = new DataTransfer();
cy.get('.ce-toolbar__settings-btn').trigger('dragstart', { dataTransfer });
cy.get('.ce-toolbar__settings-btn')
.trigger('dragstart', { dataTransfer });
cy.get('[data-cy=editorjs]')
.get('div.ce-block')
@ -156,7 +168,8 @@ describe('Drag and drop the block of Editor', function () {
.trigger('drop', { dataTransfer });
});
cy.get('.ce-toolbar__settings-btn').trigger('dragend', { dataTransfer });
cy.get('.ce-toolbar__settings-btn')
.trigger('dragend', { dataTransfer });
cy.get('[data-cy=editorjs]')
.get('div.ce-block')
@ -168,10 +181,14 @@ describe('Drag and drop the block of Editor', function () {
});
it('should drag the last block and drop before the first block.', function () {
cy.get('[data-cy=editorjs]').get('div.ce-block').eq(2).click();
cy.get('[data-cy=editorjs]')
.get('div.ce-block')
.eq(2)
.click();
const dataTransfer = new DataTransfer();
cy.get('.ce-toolbar__settings-btn').trigger('dragstart', { dataTransfer });
cy.get('.ce-toolbar__settings-btn')
.trigger('dragstart', { dataTransfer });
cy.get('[data-cy=editorjs]')
.get('div.ce-block')
@ -196,7 +213,8 @@ describe('Drag and drop the block of Editor', function () {
.trigger('drop', { dataTransfer });
});
cy.get('.ce-toolbar__settings-btn').trigger('dragend', { dataTransfer });
cy.get('.ce-toolbar__settings-btn')
.trigger('dragend', { dataTransfer });
cy.get('[data-cy=editorjs]')
.get('div.ce-block')
@ -215,11 +233,19 @@ describe('Drag and drop the block of Editor', function () {
.trigger('keydown', {
shiftKey: true,
keyCode: _.keyCodes.DOWN,
})
.click();
});
cy.get('[data-cy=editorjs]')
.get('div.ce-block')
.eq(1)
.trigger("mouseenter")
.trigger("mousemove")
.trigger("mouseleave");
const dataTransfer = new DataTransfer();
cy.get('.ce-toolbar__settings-btn').trigger('dragstart', { dataTransfer });
cy.get('.ce-toolbar__settings-btn')
.trigger('dragstart', { dataTransfer });
cy.get('[data-cy=editorjs]')
.get('div.ce-block')
@ -263,11 +289,18 @@ describe('Drag and drop the block of Editor', function () {
.trigger('keydown', {
shiftKey: true,
keyCode: _.keyCodes.DOWN,
})
.click();
});
cy.get('[data-cy=editorjs]')
.get('div.ce-block')
.eq(2)
.trigger("mouseenter")
.trigger("mousemove")
.trigger("mouseleave");
const dataTransfer = new DataTransfer();
cy.get('.ce-toolbar__settings-btn').trigger('dragstart', { dataTransfer });
cy.get('.ce-toolbar__settings-btn')
.trigger('dragstart', { dataTransfer });
cy.get('[data-cy=editorjs]')
.get('div.ce-block')
@ -292,7 +325,8 @@ describe('Drag and drop the block of Editor', function () {
.trigger('drop', { dataTransfer });
});
cy.get('.ce-toolbar__settings-btn').trigger('dragend', { dataTransfer });
cy.get('.ce-toolbar__settings-btn')
.trigger('dragend', { dataTransfer });
cy.get('[data-cy=editorjs]')
.get('div.ce-block')