Skip to content

Commit

Permalink
cool#8648 clipboard: fix desktop/writer/editable_area_spec.js
Browse files Browse the repository at this point in the history
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I60028b22e570d2566a4d64b0cd70150530830852
  • Loading branch information
vmiklos authored and caolanm committed Apr 15, 2024
1 parent 406dad2 commit 359e7ec
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -1265,13 +1265,15 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editing - Basic typing', f
function selectAndCheckText(upTo, expectedText) {
var backTo = upTo === 'home' ? 'end' : 'home';
ceHelper.moveCaret(upTo, 'shift');
helper.copy();
cy.wait(500);
helper.expectTextForClipboard(expectedText);
ceHelper.moveCaret(backTo);
helper.textSelectionShouldNotExist();
}

it('Typing', function () {
helper.setDummyClipboardForCopy();
// typing paragraph 1
ceHelper.type('Hello World');
selectAndCheckText('home', 'Hello World');
Expand All @@ -1290,13 +1292,15 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editing - Basic typing', f
});

it('Typing <delete> at paragraph beginning', function () {
helper.setDummyClipboardForCopy();
ceHelper.type('Hello World');
ceHelper.moveCaret('home');
ceHelper.type('{del}');
selectAndCheckText('end', 'ello World');
});

it('Typing <enter>', function () {
helper.setDummyClipboardForCopy();
// typing 4 paragraphs
ceHelper.type('Hello World');
ceHelper.type('{enter}');
Expand All @@ -1316,6 +1320,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editing - Basic typing', f
});

it('Typing <backspace>', function () {
helper.setDummyClipboardForCopy();
ceHelper.type('Hello World');
ceHelper.moveCaret('left','',5);
ceHelper.type('{backspace}');
Expand Down Expand Up @@ -1348,6 +1353,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Editing - Basic typing', f
});

it('Typing <delete>', function () {
helper.setDummyClipboardForCopy();
ceHelper.type('Hello World');
ceHelper.moveCaret('left','',6);
ceHelper.type('{del}');
Expand Down

0 comments on commit 359e7ec

Please sign in to comment.