From 645ea9356ef315154681d093cd6a42c1a8984e12 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kuty=C5=82a?= Date: Thu, 15 Apr 2021 23:48:47 +0200 Subject: [PATCH] 17415: Fixed port and hostname, added proper test MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła --- cypress/integration/collection.spec.js | 7 +++++-- src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cypress/integration/collection.spec.js b/cypress/integration/collection.spec.js index fa3ad8e6a3..b3f06d10c8 100644 --- a/cypress/integration/collection.spec.js +++ b/cypress/integration/collection.spec.js @@ -46,10 +46,13 @@ describe('Collection panel tests', function () { cy.get('[data-cy=context-menu]').contains('Open as network folder or S3 bucket').click(); cy.get('[data-cy=download-button').click(); - const filename = path.join(downloadsFolder, `${testCollection.name}.duck`) + const filename = path.join(downloadsFolder, `${testCollection.name}.duck`); + const expectedValue = 'ProtocoldavsProvideriterateGmbHUUIDzzzzz-4zz18-oehuaangyo2timvHostname0.0.0.0Port40041Usernamecollectionuser1Labels'; cy.readFile(filename, { timeout: 15000 }) - .should('have.length.gt', 50) + .then((str) => { + expect(str.replaceAll(' ', '').replaceAll('\n', ''), expectedValue); + }) .then(() => cy.task('clearDownload', { filename })); }); }); diff --git a/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx b/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx index eec15c49ee..c4d2ede00d 100644 --- a/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx +++ b/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx @@ -59,9 +59,9 @@ const mountainduckTemplate = ({ UUID ${uuid} Hostname - ${collectionsUrl.replace('https://', ``).replace('*', uuid)} + ${collectionsUrl.replace('https://', ``).replace('*', uuid).split(':')[0]} Port - 443 + ${collectionsUrl.split(':')[2] || 443} Username ${username} Labels -- 2.30.2