From ef1017fbad2ff46f5a169bb3fc7d097b5bb746f3 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Tue, 23 Mar 2021 10:40:18 -0300 Subject: [PATCH] 17337: Removes only() call, adds failing file rename case. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- cypress/integration/collection.spec.js | 37 +++++++++++++++----------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/cypress/integration/collection.spec.js b/cypress/integration/collection.spec.js index a85be9d4bd..ab6a4e97f7 100644 --- a/cypress/integration/collection.spec.js +++ b/cypress/integration/collection.spec.js @@ -170,7 +170,12 @@ describe('Collection panel tests', function () { }) }) - it.only('renames a file using valid names', function () { + it('renames a file using valid names', function () { + function eachPair(lst, func){ + for(var i=0; i < lst.length - 1; i++){ + func(lst[i], lst[i + 1]) + } + } // Creates the collection using the admin token so we can set up // a bogus manifest text without block signatures. cy.createCollection(adminUser.token, { @@ -182,21 +187,23 @@ describe('Collection panel tests', function () { cy.loginAs(activeUser); cy.doSearch(`${this.testCollection.uuid}`); - const nameTransitions = [ - ['bar', '&'], - ['&', 'foo'], - ['foo', '&'], - ['&', 'I ❤️ ⛵️'], - ['I ❤️ ⛵️', '...'], - ['...', '#..'], - ['#..', 'some name with whitespaces'], - ['some name with whitespaces', 'some name with #2'], - ['some name with #2', 'is this name legal? I hope it is'], - ['is this name legal? I hope it is', 'some_file.pdf#'], - ['some_file.pdf#', 'some_file.pdf?'], - ['some_file.pdf?', '?some_file.pdf'] + const names = [ + 'bar', // initial name already set + '&', + 'foo', + '&', + 'I ❤️ ⛵️', + '...', + '#..', + 'some name with whitespaces', + 'some name with #2', + 'is this name legal? I hope it is', + 'some_file.pdf#', + 'some_file.pdf?', + '?some_file.pdf', + 'some%file.pdf' ]; - nameTransitions.forEach(([from, to]) => { + eachPair(names, (from, to) => { cy.get('[data-cy=collection-files-panel]') .contains(`${from}`).rightclick(); cy.get('[data-cy=context-menu]') -- 2.30.2