From fbaa1cdd31a8066e81a1114be2237ffdfdcbe910 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Fri, 23 Oct 2020 11:01:27 -0300 Subject: [PATCH] 17018: Adds integration tests exposing the bug. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- cypress/integration/collection-panel.spec.js | 19 ++++++++++++++----- .../actions/copy-to-clipboard-action.tsx | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/cypress/integration/collection-panel.spec.js b/cypress/integration/collection-panel.spec.js index c14101d8..47281868 100644 --- a/cypress/integration/collection-panel.spec.js +++ b/cypress/integration/collection-panel.spec.js @@ -63,8 +63,8 @@ describe('Collection panel tests', function() { .click() cy.get('[data-cy=context-menu]') .should('contain', 'Add to favorites') - .and(`${isWritable ? '' : 'not.'}contain`, 'Edit collection') - .type('{esc}'); // Collapse the options menu + .and(`${isWritable ? '' : 'not.'}contain`, 'Edit collection'); + cy.get('body').click(); // Collapse the menu avoiding details panel expansion cy.get('[data-cy=collection-properties-panel]') .should('contain', 'someKey') .and('contain', 'someValue') @@ -94,6 +94,15 @@ describe('Collection panel tests', function() { cy.get('[data-cy=upload-button]') .should(`${isWritable ? '' : 'not.'}contain`, 'Upload data'); }); + cy.get('[data-cy=collection-files-panel]') + .contains('bar').rightclick(); + cy.get('[data-cy=context-menu]') + .should('contain', 'Download') + .and('contain', 'Open in new tab') + .and('contain', 'Copy to clipboard') + .and(`${isWritable ? '' : 'not.'}contain`, 'Rename') + .and(`${isWritable ? '' : 'not.'}contain`, 'Remove'); + cy.get('body').click(); // Collapse the menu // Hamburger 'more options' menu button cy.get('[data-cy=collection-files-panel-options-btn]') .click() @@ -105,14 +114,14 @@ describe('Collection panel tests', function() { cy.get('[data-cy=context-menu]') // .should('contain', 'Download selected') .should(`${isWritable ? '' : 'not.'}contain`, 'Remove selected') - .type('{esc}'); // Collapse the options menu + cy.get('body').click(); // Collapse the menu // File item 'more options' button cy.get('[data-cy=file-item-options-btn') .click() cy.get('[data-cy=context-menu]') .should('contain', 'Download') - .and(`${isWritable ? '' : 'not.'}contain`, 'Remove') - .type('{esc}'); // Collapse + .and(`${isWritable ? '' : 'not.'}contain`, 'Remove'); + cy.get('body').click(); // Collapse the menu }) }) }) diff --git a/src/views-components/context-menu/actions/copy-to-clipboard-action.tsx b/src/views-components/context-menu/actions/copy-to-clipboard-action.tsx index 31ef4b97..fffcc19b 100644 --- a/src/views-components/context-menu/actions/copy-to-clipboard-action.tsx +++ b/src/views-components/context-menu/actions/copy-to-clipboard-action.tsx @@ -27,7 +27,7 @@ export const CopyToClipboardAction = (props: { href?: any, download?: any, onCli Copy to clipboard - + : null; }; \ No newline at end of file -- 2.30.2