Skip to content

Commit

Permalink
Add cypress tests for shortcut to save comments
Browse files Browse the repository at this point in the history
Using Ctrl+Enter in calc and writer.

See dce4671

Signed-off-by: Méven Car <meven.car@collabora.com>
Change-Id: Ic7e947623aac6345e4ad9c92a9454dfb5b2a4c2e
  • Loading branch information
meven committed Dec 2, 2024
1 parent 0604618 commit e3724f2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cypress_test/integration_tests/desktop/calc/annotation_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,32 @@ describe(['tagdesktop'], 'Annotation Tests', function() {
cy.cGet('#comment-container-1').should('exist');
});

it('Modify and Save using shortcut Ctrl+Enter',function() {
desktopHelper.insertComment();

cy.cGet('#comment-container-1').should('exist');

cy.cGet('#comment-container-1').then(function (element) {
element[0].style.visibility = '';
element[0].style.display = '';
});
cy.cGet('#comment-container-1').trigger('mouseover');
cy.cGet('#annotation-content-area-1').should('contain','some text');
cy.cGet('#comment-annotation-menu-1').click();
cy.cGet('body').contains('.context-menu-item','Modify').click();
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');

cy.cGet('annotation-modify-textarea-1').type('{ctrl}{enter}');

cy.cGet('#comment-container-1').then(function (element) {
element[0].style.visibility = '';
element[0].style.display = '';
});
cy.cGet('#annotation-content-area-1').trigger('mouseover');
cy.cGet('#annotation-content-area-1').should('contain','some other text, some text');
cy.cGet('#comment-container-1').should('exist');
});

it('Reply should not be possible', function() {
desktopHelper.insertComment();

Expand Down
15 changes: 15 additions & 0 deletions cypress_test/integration_tests/desktop/writer/annotation_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ describe(['tagdesktop'], 'Annotation Tests', function() {
cy.cGet('#annotation-content-area-1').should('contain','some other text, some text0');
});

it('Modify and Save using shortcut Ctrl+Enter',function() {
desktopHelper.insertComment();

cy.cGet('.cool-annotation-content-wrapper').should('exist');
cy.cGet('#annotation-content-area-1').should('contain','some text0');
cy.cGet('#comment-annotation-menu-1').click();
cy.cGet('body').contains('.context-menu-item', 'Modify').click();
cy.cGet('#annotation-modify-textarea-1').type('some other text, ');

cy.cGet('annotation-modify-textarea-1').type('{ctrl}{enter}');

cy.cGet('.cool-annotation-content-wrapper').should('exist');
cy.cGet('#annotation-content-area-1').should('contain','some other text, some text0');
});

it('Reply', function() {
desktopHelper.insertComment();

Expand Down

0 comments on commit e3724f2

Please sign in to comment.