cozy-sharing 6.0.2 → 6.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/SharingBanner/hooks/useSharingInfos.js +35 -37
- package/dist/SharingBanner/hooks/useSharingInfos.spec.js +40 -44
- package/dist/SharingProvider.js +351 -375
- package/dist/SharingProvider.spec.js +29 -33
- package/dist/components/CozyPassFingerprintDialogContent.spec.js +14 -16
- package/dist/components/Recipient/LinkRecipientPermissions.js +25 -27
- package/dist/components/Recipient/Recipient.spec.js +39 -43
- package/dist/components/Recipient/RecipientPermissions.js +20 -22
- package/dist/components/ShareButton.js +0 -2
- package/dist/components/ShareByEmail.js +53 -55
- package/dist/components/ShareByEmail.spec.js +50 -52
- package/dist/components/ShareByLink.js +73 -79
- package/dist/components/ShareDialogCozyToCozy.spec.js +238 -264
- package/dist/components/ShareDialogTwoStepsConfirmationContainer.js +33 -35
- package/dist/components/ShareDialogTwoStepsConfirmationContainer.spec.js +240 -266
- package/dist/components/SharedBadge.js +0 -2
- package/dist/components/badge.styl +7 -5
- package/dist/components/button.styl +11 -12
- package/dist/components/useFetchDocumentPath.js +16 -18
- package/dist/fetchNextPermissions.js +15 -17
- package/dist/getSharedDocument.js +13 -15
- package/dist/getSharedDocument.spec.js +10 -12
- package/dist/helpers/contacts.js +65 -69
- package/dist/helpers/contacts.spec.js +30 -32
- package/dist/helpers/files.js +26 -28
- package/dist/helpers/files.spec.js +54 -58
- package/dist/helpers/sharings.js +56 -60
- package/dist/helpers/synchronousJobQueue.js +19 -21
- package/dist/helpers/synchronousJobQueue.spec.js +39 -43
- package/dist/stylesheet.css +28 -820
- package/package.json +3 -3
- package/src/components/badge.styl +7 -5
- package/src/components/button.styl +11 -12
|
@@ -15,28 +15,26 @@ export var useFetchDocumentPath = function useFetchDocumentPath(client, document
|
|
|
15
15
|
_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
16
16
|
var path;
|
|
17
17
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
18
|
-
while (1) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return fetchFilesPaths(client, document._type, [document]);
|
|
18
|
+
while (1) switch (_context.prev = _context.next) {
|
|
19
|
+
case 0:
|
|
20
|
+
_context.prev = 0;
|
|
21
|
+
_context.next = 3;
|
|
22
|
+
return fetchFilesPaths(client, document._type, [document]);
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
case 3:
|
|
25
|
+
path = _context.sent;
|
|
26
|
+
setDocumentPath(path[0]); // eslint-disable-next-line
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
_context.next = 9;
|
|
29
|
+
break;
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
case 7:
|
|
32
|
+
_context.prev = 7;
|
|
33
|
+
_context.t0 = _context["catch"](0);
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
35
|
+
case 9:
|
|
36
|
+
case "end":
|
|
37
|
+
return _context.stop();
|
|
40
38
|
}
|
|
41
39
|
}, _callee, null, [[0, 7]]);
|
|
42
40
|
}))();
|
|
@@ -13,26 +13,24 @@ export var fetchNextPermissions = /*#__PURE__*/function () {
|
|
|
13
13
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(permissions, dispatch, permissionCol) {
|
|
14
14
|
var resp;
|
|
15
15
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16
|
-
while (1) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
16
|
+
while (1) switch (_context.prev = _context.next) {
|
|
17
|
+
case 0:
|
|
18
|
+
if (!(permissions.links && permissions.links.next)) {
|
|
19
|
+
_context.next = 6;
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
_context.next = 3;
|
|
24
|
+
return permissionCol.fetchPermissionsByLink(permissions);
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
case 3:
|
|
27
|
+
resp = _context.sent;
|
|
28
|
+
dispatch(addSharingLink(resp.data));
|
|
29
|
+
return _context.abrupt("return", fetchNextPermissions(resp, dispatch, permissionCol));
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
31
|
+
case 6:
|
|
32
|
+
case "end":
|
|
33
|
+
return _context.stop();
|
|
36
34
|
}
|
|
37
35
|
}, _callee);
|
|
38
36
|
}));
|
|
@@ -7,24 +7,22 @@ var getSharedDocument = /*#__PURE__*/function () {
|
|
|
7
7
|
var _yield$client$collect, permissionsData, permissions, sharedDocumentId;
|
|
8
8
|
|
|
9
9
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
10
|
-
while (1) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return client.collection('io.cozy.permissions').getOwnPermissions();
|
|
10
|
+
while (1) switch (_context.prev = _context.next) {
|
|
11
|
+
case 0:
|
|
12
|
+
_context.next = 2;
|
|
13
|
+
return client.collection('io.cozy.permissions').getOwnPermissions();
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
case 2:
|
|
16
|
+
_yield$client$collect = _context.sent;
|
|
17
|
+
permissionsData = _yield$client$collect.data;
|
|
18
|
+
permissions = permissionsData.attributes.permissions; // permissions contains several named keys, but the one to use depends on the situation. Using the first one is what we want in all known cases.
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
sharedDocumentId = get(Object.values(permissions), '0.values.0');
|
|
21
|
+
return _context.abrupt("return", sharedDocumentId);
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
23
|
+
case 7:
|
|
24
|
+
case "end":
|
|
25
|
+
return _context.stop();
|
|
28
26
|
}
|
|
29
27
|
}, _callee);
|
|
30
28
|
}));
|
|
@@ -30,20 +30,18 @@ describe('Getting the shared document id', function () {
|
|
|
30
30
|
it('should get the id', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
31
31
|
var id;
|
|
32
32
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
33
|
-
while (1) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return getSharedDocument(mockClient);
|
|
33
|
+
while (1) switch (_context.prev = _context.next) {
|
|
34
|
+
case 0:
|
|
35
|
+
_context.next = 2;
|
|
36
|
+
return getSharedDocument(mockClient);
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
case 2:
|
|
39
|
+
id = _context.sent;
|
|
40
|
+
expect(id).toEqual('myshareid');
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
42
|
+
case 4:
|
|
43
|
+
case "end":
|
|
44
|
+
return _context.stop();
|
|
47
45
|
}
|
|
48
46
|
}, _callee);
|
|
49
47
|
})));
|
package/dist/helpers/contacts.js
CHANGED
|
@@ -7,87 +7,83 @@ import { validateEmail } from '../helpers/email'; // Return the contact object i
|
|
|
7
7
|
export var getOrCreateFromArray = /*#__PURE__*/function () {
|
|
8
8
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(client, contacts, createContact) {
|
|
9
9
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
10
|
-
while (1) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
10
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
11
|
+
case 0:
|
|
12
|
+
_context2.next = 2;
|
|
13
|
+
return Promise.all(contacts.map( /*#__PURE__*/function () {
|
|
14
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(contact) {
|
|
15
|
+
var matchedContact, resp;
|
|
16
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
17
|
+
while (1) switch (_context.prev = _context.next) {
|
|
18
|
+
case 0:
|
|
19
|
+
if (!contact.id) {
|
|
20
|
+
_context.next = 4;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
return _context.abrupt("return", contact);
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
case 4:
|
|
27
|
+
if (!validateEmail(contact.email)) {
|
|
28
|
+
_context.next = 16;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
_context.next = 7;
|
|
33
|
+
return client.collection('io.cozy.contacts').find({
|
|
34
|
+
email: {
|
|
35
|
+
$elemMatch: {
|
|
36
|
+
address: contact.email
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
_id: {
|
|
40
|
+
$gt: null
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
indexedFields: ['_id']
|
|
44
|
+
});
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
case 7:
|
|
47
|
+
matchedContact = _context.sent;
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
if (!(matchedContact.data.length > 0)) {
|
|
50
|
+
_context.next = 12;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
55
53
|
|
|
56
|
-
|
|
54
|
+
return _context.abrupt("return", matchedContact.data[0]);
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
case 12:
|
|
57
|
+
_context.next = 14;
|
|
58
|
+
return createContact({
|
|
59
|
+
email: [{
|
|
60
|
+
address: contact.email,
|
|
61
|
+
primary: true
|
|
62
|
+
}]
|
|
63
|
+
});
|
|
66
64
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
case 14:
|
|
66
|
+
resp = _context.sent;
|
|
67
|
+
return _context.abrupt("return", resp.data);
|
|
70
68
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}));
|
|
69
|
+
case 16:
|
|
70
|
+
case "end":
|
|
71
|
+
return _context.stop();
|
|
72
|
+
}
|
|
73
|
+
}, _callee);
|
|
74
|
+
}));
|
|
78
75
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
return function (_x4) {
|
|
77
|
+
return _ref2.apply(this, arguments);
|
|
78
|
+
};
|
|
79
|
+
}()));
|
|
83
80
|
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
case 2:
|
|
82
|
+
return _context2.abrupt("return", _context2.sent);
|
|
86
83
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
84
|
+
case 3:
|
|
85
|
+
case "end":
|
|
86
|
+
return _context2.stop();
|
|
91
87
|
}
|
|
92
88
|
}, _callee2);
|
|
93
89
|
}));
|
|
@@ -26,42 +26,40 @@ describe('getOrCreateFromArray', function () {
|
|
|
26
26
|
it('test getOrCreateFromArray', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
27
27
|
var wantedContacts, createContacts, contacts;
|
|
28
28
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
29
|
-
while (1) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}];
|
|
29
|
+
while (1) switch (_context.prev = _context.next) {
|
|
30
|
+
case 0:
|
|
31
|
+
wantedContacts = [{
|
|
32
|
+
id: 1,
|
|
33
|
+
email: '1@cozycloud.cc'
|
|
34
|
+
}, {
|
|
35
|
+
email: 'exists@cozycloud.cc'
|
|
36
|
+
}, {
|
|
37
|
+
email: 'doesntexist@cozycloud.cc'
|
|
38
|
+
}];
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
createContacts = function createContacts(contact) {
|
|
41
|
+
return mockClient.create('io.cozy.contact', contact);
|
|
42
|
+
};
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
_context.next = 4;
|
|
45
|
+
return getOrCreateFromArray(mockClient, wantedContacts, createContacts);
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
case 4:
|
|
48
|
+
contacts = _context.sent;
|
|
49
|
+
expect(contacts).toEqual([{
|
|
50
|
+
id: 1,
|
|
51
|
+
email: '1@cozycloud.cc'
|
|
52
|
+
}, {
|
|
53
|
+
id: 2,
|
|
54
|
+
email: 'exists@cozycloud.cc'
|
|
55
|
+
}, {
|
|
56
|
+
id: 3,
|
|
57
|
+
email: 'doesntexist@cozycloud.cc'
|
|
58
|
+
}]);
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
60
|
+
case 6:
|
|
61
|
+
case "end":
|
|
62
|
+
return _context.stop();
|
|
65
63
|
}
|
|
66
64
|
}, _callee);
|
|
67
65
|
})));
|
package/dist/helpers/files.js
CHANGED
|
@@ -4,37 +4,35 @@ export var fetchFilesPaths = /*#__PURE__*/function () {
|
|
|
4
4
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(client, doctype, files) {
|
|
5
5
|
var parentDirIds, parentDirs, filePaths;
|
|
6
6
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
7
|
-
while (1) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
7
|
+
while (1) switch (_context.prev = _context.next) {
|
|
8
|
+
case 0:
|
|
9
|
+
parentDirIds = files.map(function (f) {
|
|
10
|
+
return f.dir_id;
|
|
11
|
+
}).filter(function (f, idx, arr) {
|
|
12
|
+
return arr.indexOf(f) === idx;
|
|
13
|
+
});
|
|
14
|
+
_context.next = 3;
|
|
15
|
+
return client.collection(doctype).all({
|
|
16
|
+
keys: parentDirIds
|
|
17
|
+
});
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
}).filter(function (parentDir) {
|
|
27
|
-
return parentDir !== undefined;
|
|
28
|
-
}).map(function (parentDir) {
|
|
29
|
-
var parentDirPath = parentDir.path;
|
|
30
|
-
return parentDirPath === '/' ? "/".concat(parentDir.name) : "".concat(parentDirPath, "/").concat(parentDir.name);
|
|
19
|
+
case 3:
|
|
20
|
+
parentDirs = _context.sent;
|
|
21
|
+
filePaths = files.map(function (f) {
|
|
22
|
+
return parentDirs.data.find(function (d) {
|
|
23
|
+
return d.id === f.dir_id;
|
|
31
24
|
});
|
|
32
|
-
|
|
25
|
+
}).filter(function (parentDir) {
|
|
26
|
+
return parentDir !== undefined;
|
|
27
|
+
}).map(function (parentDir) {
|
|
28
|
+
var parentDirPath = parentDir.path;
|
|
29
|
+
return parentDirPath === '/' ? "/".concat(parentDir.name) : "".concat(parentDirPath, "/").concat(parentDir.name);
|
|
30
|
+
});
|
|
31
|
+
return _context.abrupt("return", filePaths);
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
33
|
+
case 6:
|
|
34
|
+
case "end":
|
|
35
|
+
return _context.stop();
|
|
38
36
|
}
|
|
39
37
|
}, _callee);
|
|
40
38
|
}));
|
|
@@ -5,74 +5,70 @@ describe('fetchFilesPaths', function () {
|
|
|
5
5
|
it('should handle document without path', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
6
6
|
var mockClient, documents, filePaths;
|
|
7
7
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
8
|
-
while (1) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return fetchFilesPaths(mockClient, 'com.bitwarden.organizations', documents);
|
|
8
|
+
while (1) switch (_context.prev = _context.next) {
|
|
9
|
+
case 0:
|
|
10
|
+
mockClient = {
|
|
11
|
+
collection: function collection() {
|
|
12
|
+
return {
|
|
13
|
+
all: jest.fn().mockReturnValueOnce({
|
|
14
|
+
data: []
|
|
15
|
+
})
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
documents = [{
|
|
20
|
+
id: 'SOME_ORGANIZATION_ID',
|
|
21
|
+
name: 'SOME_ORGANISATION',
|
|
22
|
+
_type: 'com.bitwarden.organizations',
|
|
23
|
+
_id: 'SOME_ORGANIZATION_ID'
|
|
24
|
+
}];
|
|
25
|
+
_context.next = 4;
|
|
26
|
+
return fetchFilesPaths(mockClient, 'com.bitwarden.organizations', documents);
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
case 4:
|
|
29
|
+
filePaths = _context.sent;
|
|
30
|
+
expect(filePaths).toEqual([]);
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
32
|
+
case 6:
|
|
33
|
+
case "end":
|
|
34
|
+
return _context.stop();
|
|
37
35
|
}
|
|
38
36
|
}, _callee);
|
|
39
37
|
})));
|
|
40
38
|
it('should handle a document with a path', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
41
39
|
var mockClient, documents, filePaths;
|
|
42
40
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
43
|
-
while (1) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return fetchFilesPaths(mockClient, 'io.cozy.files', documents);
|
|
41
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
42
|
+
case 0:
|
|
43
|
+
mockClient = {
|
|
44
|
+
collection: function collection() {
|
|
45
|
+
return {
|
|
46
|
+
all: jest.fn().mockReturnValueOnce({
|
|
47
|
+
data: [{
|
|
48
|
+
id: 'SOME_PARENT_DIR_ID',
|
|
49
|
+
name: 'SOME_PARENT_DIR',
|
|
50
|
+
path: '/some_parent_dir'
|
|
51
|
+
}]
|
|
52
|
+
})
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
documents = [{
|
|
57
|
+
id: 'SOME_DOCUMENT_ID',
|
|
58
|
+
name: 'test',
|
|
59
|
+
type: 'io.cozy.files',
|
|
60
|
+
dir_id: 'SOME_PARENT_DIR_ID'
|
|
61
|
+
}];
|
|
62
|
+
_context2.next = 4;
|
|
63
|
+
return fetchFilesPaths(mockClient, 'io.cozy.files', documents);
|
|
67
64
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
case 4:
|
|
66
|
+
filePaths = _context2.sent;
|
|
67
|
+
expect(filePaths).toEqual(['/some_parent_dir/SOME_PARENT_DIR']);
|
|
71
68
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
69
|
+
case 6:
|
|
70
|
+
case "end":
|
|
71
|
+
return _context2.stop();
|
|
76
72
|
}
|
|
77
73
|
}, _callee2);
|
|
78
74
|
})));
|