cool#8648 clipboard: fix mobile/writer/insert_formatting_mark_spec.js

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
This commit is contained in:
Miklos Vajna 2024-04-19 14:35:23 +02:00 committed by Caolán McNamara
parent 9cca40deda
commit ad22a9f017

View file

@ -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');
});
});