[ARVADOS-WORKBENCH2] updated: 2.1.0-287-ga7c16589
Git user
git at public.arvados.org
Fri Apr 16 22:28:05 UTC 2021
Summary of changes:
cypress/integration/collection.spec.js | 23 ++++++++++++++++++----
.../webdav-s3-dialog/webdav-s3-dialog.tsx | 7 ++++---
2 files changed, 23 insertions(+), 7 deletions(-)
via a7c16589e1ae08addbd6a9aee75d5f90c1704e5c (commit)
from 645ea9356ef315154681d093cd6a42c1a8984e12 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit a7c16589e1ae08addbd6a9aee75d5f90c1704e5c
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date: Sat Apr 17 00:27:22 2021 +0200
17415: Enhanced test to check xml
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
diff --git a/cypress/integration/collection.spec.js b/cypress/integration/collection.spec.js
index b3f06d10..ea5076e1 100644
--- a/cypress/integration/collection.spec.js
+++ b/cypress/integration/collection.spec.js
@@ -32,7 +32,7 @@ describe('Collection panel tests', function () {
cy.clearLocalStorage();
});
- it('allows to download mountain duck config for a collection', () => {
+ it.only('allows to download mountain duck config for a collection', () => {
cy.createCollection(adminUser.token, {
name: `Test collection ${Math.floor(Math.random() * 999999)}`,
owner_uuid: activeUser.user.uuid,
@@ -47,11 +47,26 @@ describe('Collection panel tests', function () {
cy.get('[data-cy=download-button').click();
const filename = path.join(downloadsFolder, `${testCollection.name}.duck`);
- const expectedValue = '<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEplistPUBLIC"-//Apple//DTDPLIST1.0//EN""http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plistversion="1.0"><dict><key>Protocol</key><string>davs</string><key>Provider</key><string>iterateGmbH</string><key>UUID</key><string>zzzzz-4zz18-oehuaangyo2timv</string><key>Hostname</key><string>0.0.0.0</string><key>Port</key><string>40041</string><key>Username</key><string>collectionuser1</string><key>Labels</key><array></array></dict></plist>';
cy.readFile(filename, { timeout: 15000 })
- .then((str) => {
- expect(str.replaceAll(' ', '').replaceAll('\n', ''), expectedValue);
+ .then((body) => {
+ const childrenCollection = Array.prototype.slice.call(Cypress.$(body).find('dict')[0].children);
+ const map = {};
+ let i, j = 2;
+
+ for (i=0; i < childrenCollection.length; i += j) {
+ map[childrenCollection[i].outerText] = childrenCollection[i + 1].outerText;
+ }
+
+ cy.get('#simple-tabpanel-0').find('a')
+ .then((a) => {
+ const [host, port] = a.text().split('@')[1].split('/')[0].split(':');
+ expect(map['Protocol']).to.equal('davs');
+ expect(map['UUID']).to.equal(testCollection.uuid);
+ expect(map['Username']).to.equal(activeUser.user.username);
+ expect(map['Port']).to.equal(port);
+ expect(map['Hostname']).to.equal(host);
+ });
})
.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 c4d2ede0..c1acfd80 100644
--- a/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx
+++ b/src/views-components/webdav-s3-dialog/webdav-s3-dialog.tsx
@@ -47,7 +47,8 @@ function TabPanel(props: TabPanelData) {
const mountainduckTemplate = ({
uuid,
username,
- collectionsUrl,
+ cyberDavStr,
+ collectionsUrl
}: any) => `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@@ -61,7 +62,7 @@ const mountainduckTemplate = ({
<key>Hostname</key>
<string>${collectionsUrl.replace('https://', ``).replace('*', uuid).split(':')[0]}</string>
<key>Port</key>
- <string>${collectionsUrl.split(':')[2] || 443}</string>
+ <string>${(cyberDavStr.split(':')[2] || '443').split('/')[0]}</string>
<key>Username</key>
<string>${username}</string>
<key>Labels</key>
@@ -193,7 +194,7 @@ export const WebDavS3InfoDialog = compose(
<Button
data-cy='download-button'
className={props.classes.downloadButton}
- onClick={() => downloadMountainduckFileHandler(`${props.data.collectionName || props.data.uuid}.duck`, mountainduckTemplate(props.data))}
+ onClick={() => downloadMountainduckFileHandler(`${props.data.collectionName || props.data.uuid}.duck`, mountainduckTemplate({ ...props.data, cyberDavStr }))}
variant='contained'
color='primary'
size='small'>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list