Skip to content

Commit

Permalink
cool#8648 clipboard: fix mobile/writer/insert_formatting_mark_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: I302edb920801895f1a728313b5e9a9405ec7d396
  • Loading branch information
vmiklos authored and caolanm committed Apr 22, 2024
1 parent 9cca40d commit ad22a9f
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,45 +23,59 @@ describe(['tagmobile', 'tagnextcloud', 'tagproxy'], 'Insert formatting mark via
});

it('Insert non-breaking space.', function() {
helper.setDummyClipboardForCopy();
cy.cGet('body').contains('.menu-entry-with-icon', 'Insert non-breaking space').click();
writerHelper.selectAllTextOfDoc();
helper.copy();
cy.cGet('#copy-paste-container p').should('contain.text', '\u00a0');
});

it('Insert non-breaking hyphen.', function() {
helper.setDummyClipboardForCopy();
cy.cGet('body').contains('.menu-entry-with-icon', 'Insert non-breaking hyphen').click();
writerHelper.selectAllTextOfDoc();
helper.copy();
cy.cGet('#copy-paste-container p').should('contain.text', '\u2011');
});

it('Insert soft hyphen.', function() {
helper.setDummyClipboardForCopy();
cy.cGet('body').contains('.menu-entry-with-icon', 'Insert soft Hyphen').click();
writerHelper.selectAllTextOfDoc();
helper.copy();
cy.cGet('#copy-paste-container p').should('contain.text', '\u00ad');
});

it('Insert no-width optional break.', function() {
helper.setDummyClipboardForCopy();
cy.cGet('body').contains('.menu-entry-with-icon', 'No-width Optional Break').click();
writerHelper.selectAllTextOfDoc();
helper.copy();
cy.cGet('#copy-paste-container p').should('contain.text', '\u200b');
});

it('Insert word joiner.', function() {
helper.setDummyClipboardForCopy();
cy.cGet('body').contains('.menu-entry-with-icon', 'Word Joiner').click();
writerHelper.selectAllTextOfDoc();
helper.copy();
cy.cGet('#copy-paste-container p').should('exist');
cy.cGet('#copy-paste-container p').should('contain.text', '\u2060');
});

it('Insert left-to-right mark.', function() {
helper.setDummyClipboardForCopy();
cy.cGet('body').contains('.menu-entry-with-icon', 'Left-to-right Mark').click();
writerHelper.selectAllTextOfDoc();
helper.copy();
cy.cGet('#copy-paste-container p').should('contain.text', '\u200e');
});

it('Insert right-to-left mark.', function() {
helper.setDummyClipboardForCopy();
cy.cGet('body').contains('.menu-entry-with-icon', 'Right-to-left Mark').click();
writerHelper.selectAllTextOfDoc();
helper.copy();
cy.cGet('#copy-paste-container p').should('contain.text', '\u200f');
});
});

0 comments on commit ad22a9f

Please sign in to comment.