17098: Adds integration test checks for the new action.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Wed, 25 Nov 2020 15:19:02 +0000 (12:19 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Wed, 25 Nov 2020 15:19:02 +0000 (12:19 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

cypress/integration/collection-panel.spec.js
src/store/collections/collection-version-actions.ts

index 2b9957a3ee94262e6f31111eacb0d8d2c7688798..a44edd7eaf137d3feb5cdcbf6c62fb603bc64d46 100644 (file)
@@ -352,6 +352,11 @@ describe('Collection panel tests', function() {
             cy.get('[data-cy=collection-files-panel]')
                 .should('contain', 'foo').and('contain', 'bar');
 
+            // Check that old collection action is available on context menu
+            cy.get('[data-cy=collection-panel-options-btn]').click()
+            cy.get('[data-cy=context-menu]').should('contain', 'Recover version')
+            cy.get('body').click(); // Collapse the menu avoiding details panel expansion
+
             // Click on "head version" link, confirm that it's the latest version.
             cy.get('[data-cy=collection-info-panel]').contains('head version').click();
             cy.get('[data-cy=collection-info-panel]')
@@ -362,6 +367,11 @@ describe('Collection panel tests', function() {
             cy.get('[data-cy=collection-files-panel]').
                 should('not.contain', 'foo').and('contain', 'bar');
 
+            // Check that old collection action isn't available on context menu
+            cy.get('[data-cy=collection-panel-options-btn]').click()
+            cy.get('[data-cy=context-menu]').should('not.contain', 'Recover version')
+            cy.get('body').click(); // Collapse the menu avoiding details panel expansion
+
             // Make another change, confirm new version.
             cy.get('[data-cy=collection-panel-options-btn]').click();
             cy.get('[data-cy=context-menu]').contains('Edit collection').click();
index 68b6a181ed60b7e2a99ddcb53bc11105b8dcb8fe..007dedcdf45d95c594bdceb11b44167cf8760f74 100644 (file)
@@ -24,7 +24,7 @@ export const recoverVersion = (resourceUuid: string) =>
             dispatch<any>(navigateTo(headVersion.uuid));
         } catch (e) {
             dispatch(snackbarActions.OPEN_SNACKBAR({
-                message: `Couldn't make new version: ${e.errors[0]}`,
+                message: `Couldn't recover version: ${e.errors[0]}`,
                 hideDuration: 2000,
                 kind: SnackbarKind.ERROR
             }));