[ACA-1799] add tests for share file (#727)

* initial work

* shared link created through API

* add tests for share file on all list views

* remove utc for end of day

* remove hours and minutes

* update unit test

* workaround

* update docker settings for tomcat

* tomcat setup for e2e
This commit is contained in:
Adina Parpalita
2018-10-18 16:27:54 +03:00
committed by Denys Vuika
parent 9012c0832b
commit 30b445dde9
15 changed files with 1312 additions and 29 deletions

View File

@@ -317,7 +317,7 @@ describe('ShareDialogComponent', () => {
fixture.detectChanges();
expect(nodesApiService.updateNode).toHaveBeenCalledWith('nodeId', {
properties: { 'qshare:expiryDate': date.utc().format() }
properties: { 'qshare:expiryDate': date }
});
});
});

View File

@@ -103,7 +103,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
this.baseShareUrl = this.data.baseShareUrl;
const properties = this.data.node.entry.properties;
if (properties && !properties['qshare:sharedId']) {
if (!properties || !properties['qshare:sharedId']) {
this.createSharedLinks(this.data.node.entry.id);
} else {
this.sharedId = properties['qshare:sharedId'];
@@ -174,7 +174,13 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
(sharedLink: SharedLinkEntry) => {
if (sharedLink.entry) {
this.sharedId = sharedLink.entry.id;
this.data.node.entry.properties['qshare:sharedId'] = this.sharedId;
if (this.data.node.entry.properties) {
this.data.node.entry.properties['qshare:sharedId'] = this.sharedId;
} else {
this.data.node.entry.properties = {
'qshare:sharedId': this.sharedId
};
}
this.isDisabled = false;
this.isFileShared = true;
@@ -217,12 +223,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
private updateNode(date: moment.Moment): Observable<MinimalNodeEntryEntity> {
return this.nodesApiService.updateNode(this.data.node.entry.id, {
properties: {
'qshare:expiryDate': date
? date
.utc()
.endOf('day')
.format()
: null
'qshare:expiryDate': date ? date.endOf('day') : null
}
});
}
@@ -230,6 +231,6 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
private updateEntryExpiryDate(date: moment.Moment) {
const { properties } = this.data.node.entry;
properties['qshare:expiryDate'] = date ? date.local() : null;
properties['qshare:expiryDate'] = date ? date.toDate() : null;
}
}