cozy-sharing 6.0.3 → 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 +11 -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 +2 -2
- package/src/components/badge.styl +7 -5
- package/src/components/button.styl +11 -12
|
@@ -47,49 +47,45 @@ describe('ShareDialogCozyToCozy', function () {
|
|
|
47
47
|
var _deferablePromise, promise, resolve, props, _setup2, getByText;
|
|
48
48
|
|
|
49
49
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
50
|
-
while (1) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
51
|
+
case 0:
|
|
52
|
+
_deferablePromise = deferablePromise(), promise = _deferablePromise.promise, resolve = _deferablePromise.resolve;
|
|
53
|
+
props = _objectSpread(_objectSpread({}, getMockProps()), {}, {
|
|
54
|
+
twoStepsConfirmationMethods: {
|
|
55
|
+
getRecipientsToBeConfirmed: jest.fn(function () {
|
|
56
|
+
return promise;
|
|
57
|
+
}),
|
|
58
|
+
rejectRecipient: jest.fn()
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
_setup2 = setup(props), getByText = _setup2.getByText;
|
|
62
|
+
expect(getByText('Loading in progress')).toBeTruthy();
|
|
63
|
+
_context2.next = 6;
|
|
64
|
+
return act( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
65
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
66
|
+
while (1) switch (_context.prev = _context.next) {
|
|
67
|
+
case 0:
|
|
68
|
+
resolve([{
|
|
69
|
+
name: recipientBob.public_name,
|
|
70
|
+
id: 'SOME_ID',
|
|
71
|
+
email: recipientBob.email
|
|
72
|
+
}]);
|
|
73
|
+
_context.next = 3;
|
|
57
74
|
return promise;
|
|
58
|
-
|
|
59
|
-
|
|
75
|
+
|
|
76
|
+
case 3:
|
|
77
|
+
case "end":
|
|
78
|
+
return _context.stop();
|
|
60
79
|
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
resolve([{
|
|
71
|
-
name: recipientBob.public_name,
|
|
72
|
-
id: 'SOME_ID',
|
|
73
|
-
email: recipientBob.email
|
|
74
|
-
}]);
|
|
75
|
-
_context.next = 3;
|
|
76
|
-
return promise;
|
|
77
|
-
|
|
78
|
-
case 3:
|
|
79
|
-
case "end":
|
|
80
|
-
return _context.stop();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}, _callee);
|
|
84
|
-
})));
|
|
85
|
-
|
|
86
|
-
case 6:
|
|
87
|
-
expect(getByText('Verify')).toBeTruthy();
|
|
88
|
-
|
|
89
|
-
case 7:
|
|
90
|
-
case "end":
|
|
91
|
-
return _context2.stop();
|
|
92
|
-
}
|
|
80
|
+
}, _callee);
|
|
81
|
+
})));
|
|
82
|
+
|
|
83
|
+
case 6:
|
|
84
|
+
expect(getByText('Verify')).toBeTruthy();
|
|
85
|
+
|
|
86
|
+
case 7:
|
|
87
|
+
case "end":
|
|
88
|
+
return _context2.stop();
|
|
93
89
|
}
|
|
94
90
|
}, _callee2);
|
|
95
91
|
})));
|
|
@@ -97,49 +93,45 @@ describe('ShareDialogCozyToCozy', function () {
|
|
|
97
93
|
var _deferablePromise2, promise, resolve, props, _setup3, getByText, getAllByText;
|
|
98
94
|
|
|
99
95
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
100
|
-
while (1) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
96
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
97
|
+
case 0:
|
|
98
|
+
_deferablePromise2 = deferablePromise(), promise = _deferablePromise2.promise, resolve = _deferablePromise2.resolve;
|
|
99
|
+
props = _objectSpread(_objectSpread({}, getMockProps()), {}, {
|
|
100
|
+
twoStepsConfirmationMethods: {
|
|
101
|
+
getRecipientsToBeConfirmed: jest.fn(function () {
|
|
102
|
+
return promise;
|
|
103
|
+
}),
|
|
104
|
+
rejectRecipient: jest.fn()
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
_setup3 = setup(props), getByText = _setup3.getByText, getAllByText = _setup3.getAllByText;
|
|
108
|
+
_context4.next = 5;
|
|
109
|
+
return act( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
110
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
111
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
112
|
+
case 0:
|
|
113
|
+
resolve([{
|
|
114
|
+
name: recipientBob.public_name,
|
|
115
|
+
id: 'SOME_ID',
|
|
116
|
+
email: recipientBob.email
|
|
117
|
+
}]);
|
|
118
|
+
_context3.next = 3;
|
|
107
119
|
return promise;
|
|
108
|
-
|
|
109
|
-
|
|
120
|
+
|
|
121
|
+
case 3:
|
|
122
|
+
case "end":
|
|
123
|
+
return _context3.stop();
|
|
110
124
|
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
id: 'SOME_ID',
|
|
122
|
-
email: recipientBob.email
|
|
123
|
-
}]);
|
|
124
|
-
_context3.next = 3;
|
|
125
|
-
return promise;
|
|
126
|
-
|
|
127
|
-
case 3:
|
|
128
|
-
case "end":
|
|
129
|
-
return _context3.stop();
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}, _callee3);
|
|
133
|
-
})));
|
|
134
|
-
|
|
135
|
-
case 5:
|
|
136
|
-
expect(getAllByText('Verify')).toHaveLength(1);
|
|
137
|
-
expect(getByText(/Some contacts are waiting for your confirmation/i)).toBeTruthy();
|
|
138
|
-
|
|
139
|
-
case 7:
|
|
140
|
-
case "end":
|
|
141
|
-
return _context4.stop();
|
|
142
|
-
}
|
|
125
|
+
}, _callee3);
|
|
126
|
+
})));
|
|
127
|
+
|
|
128
|
+
case 5:
|
|
129
|
+
expect(getAllByText('Verify')).toHaveLength(1);
|
|
130
|
+
expect(getByText(/Some contacts are waiting for your confirmation/i)).toBeTruthy();
|
|
131
|
+
|
|
132
|
+
case 7:
|
|
133
|
+
case "end":
|
|
134
|
+
return _context4.stop();
|
|
143
135
|
}
|
|
144
136
|
}, _callee4);
|
|
145
137
|
})));
|
|
@@ -147,53 +139,49 @@ describe('ShareDialogCozyToCozy', function () {
|
|
|
147
139
|
var _deferablePromise3, promise, resolve, props, _setup4, getByText, getAllByText;
|
|
148
140
|
|
|
149
141
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
150
|
-
while (1) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
142
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
143
|
+
case 0:
|
|
144
|
+
_deferablePromise3 = deferablePromise(), promise = _deferablePromise3.promise, resolve = _deferablePromise3.resolve;
|
|
145
|
+
props = _objectSpread(_objectSpread({}, getMockProps()), {}, {
|
|
146
|
+
twoStepsConfirmationMethods: {
|
|
147
|
+
getRecipientsToBeConfirmed: jest.fn(function () {
|
|
148
|
+
return promise;
|
|
149
|
+
}),
|
|
150
|
+
rejectRecipient: jest.fn()
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
_setup4 = setup(props), getByText = _setup4.getByText, getAllByText = _setup4.getAllByText;
|
|
154
|
+
_context6.next = 5;
|
|
155
|
+
return act( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
156
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
157
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
158
|
+
case 0:
|
|
159
|
+
resolve([{
|
|
160
|
+
name: recipientBob.public_name,
|
|
161
|
+
id: 'SOME_ID',
|
|
162
|
+
email: recipientBob.email
|
|
163
|
+
}, {
|
|
164
|
+
name: recipientClaude.public_name,
|
|
165
|
+
id: 'SOME_OTHER_ID',
|
|
166
|
+
email: recipientClaude.email
|
|
167
|
+
}]);
|
|
168
|
+
_context5.next = 3;
|
|
157
169
|
return promise;
|
|
158
|
-
|
|
159
|
-
|
|
170
|
+
|
|
171
|
+
case 3:
|
|
172
|
+
case "end":
|
|
173
|
+
return _context5.stop();
|
|
160
174
|
}
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
id: 'SOME_ID',
|
|
172
|
-
email: recipientBob.email
|
|
173
|
-
}, {
|
|
174
|
-
name: recipientClaude.public_name,
|
|
175
|
-
id: 'SOME_OTHER_ID',
|
|
176
|
-
email: recipientClaude.email
|
|
177
|
-
}]);
|
|
178
|
-
_context5.next = 3;
|
|
179
|
-
return promise;
|
|
180
|
-
|
|
181
|
-
case 3:
|
|
182
|
-
case "end":
|
|
183
|
-
return _context5.stop();
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}, _callee5);
|
|
187
|
-
})));
|
|
188
|
-
|
|
189
|
-
case 5:
|
|
190
|
-
expect(getAllByText('Verify')).toHaveLength(2);
|
|
191
|
-
expect(getByText(/2 contacts are waiting for your confirmation/i)).toBeTruthy();
|
|
192
|
-
|
|
193
|
-
case 7:
|
|
194
|
-
case "end":
|
|
195
|
-
return _context6.stop();
|
|
196
|
-
}
|
|
175
|
+
}, _callee5);
|
|
176
|
+
})));
|
|
177
|
+
|
|
178
|
+
case 5:
|
|
179
|
+
expect(getAllByText('Verify')).toHaveLength(2);
|
|
180
|
+
expect(getByText(/2 contacts are waiting for your confirmation/i)).toBeTruthy();
|
|
181
|
+
|
|
182
|
+
case 7:
|
|
183
|
+
case "end":
|
|
184
|
+
return _context6.stop();
|
|
197
185
|
}
|
|
198
186
|
}, _callee6);
|
|
199
187
|
})));
|
|
@@ -201,45 +189,41 @@ describe('ShareDialogCozyToCozy', function () {
|
|
|
201
189
|
var _deferablePromise4, promise, resolve, props, _setup5, queryByText;
|
|
202
190
|
|
|
203
191
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
204
|
-
while (1) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
192
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
193
|
+
case 0:
|
|
194
|
+
_deferablePromise4 = deferablePromise(), promise = _deferablePromise4.promise, resolve = _deferablePromise4.resolve;
|
|
195
|
+
props = _objectSpread(_objectSpread({}, getMockProps()), {}, {
|
|
196
|
+
twoStepsConfirmationMethods: {
|
|
197
|
+
getRecipientsToBeConfirmed: jest.fn(function () {
|
|
198
|
+
return promise;
|
|
199
|
+
}),
|
|
200
|
+
rejectRecipient: jest.fn()
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
_setup5 = setup(props), queryByText = _setup5.queryByText;
|
|
204
|
+
_context8.next = 5;
|
|
205
|
+
return act( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
206
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
207
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
208
|
+
case 0:
|
|
209
|
+
resolve([]);
|
|
210
|
+
_context7.next = 3;
|
|
211
211
|
return promise;
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
|
|
213
|
+
case 3:
|
|
214
|
+
case "end":
|
|
215
|
+
return _context7.stop();
|
|
214
216
|
}
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
return promise;
|
|
226
|
-
|
|
227
|
-
case 3:
|
|
228
|
-
case "end":
|
|
229
|
-
return _context7.stop();
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}, _callee7);
|
|
233
|
-
})));
|
|
234
|
-
|
|
235
|
-
case 5:
|
|
236
|
-
expect(queryByText('Verify')).not.toBeInTheDocument();
|
|
237
|
-
expect(queryByText(/waiting for your confirmation/i)).not.toBeInTheDocument();
|
|
238
|
-
|
|
239
|
-
case 7:
|
|
240
|
-
case "end":
|
|
241
|
-
return _context8.stop();
|
|
242
|
-
}
|
|
217
|
+
}, _callee7);
|
|
218
|
+
})));
|
|
219
|
+
|
|
220
|
+
case 5:
|
|
221
|
+
expect(queryByText('Verify')).not.toBeInTheDocument();
|
|
222
|
+
expect(queryByText(/waiting for your confirmation/i)).not.toBeInTheDocument();
|
|
223
|
+
|
|
224
|
+
case 7:
|
|
225
|
+
case "end":
|
|
226
|
+
return _context8.stop();
|
|
243
227
|
}
|
|
244
228
|
}, _callee8);
|
|
245
229
|
})));
|
|
@@ -247,108 +231,98 @@ describe('ShareDialogCozyToCozy', function () {
|
|
|
247
231
|
var _deferablePromise5, promise, resolve, rejectRecipient, props, _setup6, getByText, verifyButton, rejectButton, confirmRejectButton;
|
|
248
232
|
|
|
249
233
|
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
250
|
-
while (1) {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
234
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
235
|
+
case 0:
|
|
236
|
+
_deferablePromise5 = deferablePromise(), promise = _deferablePromise5.promise, resolve = _deferablePromise5.resolve;
|
|
237
|
+
rejectRecipient = jest.fn(function () {
|
|
238
|
+
return Promise.resolve();
|
|
239
|
+
});
|
|
240
|
+
props = _objectSpread(_objectSpread({}, getMockProps()), {}, {
|
|
241
|
+
twoStepsConfirmationMethods: {
|
|
242
|
+
getRecipientsToBeConfirmed: jest.fn(function () {
|
|
243
|
+
return promise;
|
|
244
|
+
}),
|
|
245
|
+
rejectRecipient: rejectRecipient,
|
|
246
|
+
recipientConfirmationDialogContent: CozyPassFingerprintDialogContent
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
_setup6 = setup(props), getByText = _setup6.getByText;
|
|
250
|
+
_context13.next = 6;
|
|
251
|
+
return act( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
252
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
253
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
254
|
+
case 0:
|
|
255
|
+
resolve([{
|
|
256
|
+
name: recipientBob.public_name,
|
|
257
|
+
id: 'SOME_ID',
|
|
258
|
+
email: recipientBob.email,
|
|
259
|
+
fingerprintPhrase: 'SOME_FINGERPRINT_PHRASE'
|
|
260
|
+
}]);
|
|
261
|
+
_context9.next = 3;
|
|
260
262
|
return promise;
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
263
|
+
|
|
264
|
+
case 3:
|
|
265
|
+
case "end":
|
|
266
|
+
return _context9.stop();
|
|
264
267
|
}
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}, _callee11);
|
|
324
|
-
})));
|
|
325
|
-
|
|
326
|
-
case 12:
|
|
327
|
-
expect(getByText("Do you really want to reject contact ".concat(recipientBob.public_name, " (").concat(recipientBob.email, ")?"))).toBeTruthy();
|
|
328
|
-
confirmRejectButton = getByText('Reject');
|
|
329
|
-
_context13.next = 16;
|
|
330
|
-
return act( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
331
|
-
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
332
|
-
while (1) {
|
|
333
|
-
switch (_context12.prev = _context12.next) {
|
|
334
|
-
case 0:
|
|
335
|
-
return _context12.abrupt("return", fireEvent.click(confirmRejectButton));
|
|
336
|
-
|
|
337
|
-
case 1:
|
|
338
|
-
case "end":
|
|
339
|
-
return _context12.stop();
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
}, _callee12);
|
|
343
|
-
})));
|
|
344
|
-
|
|
345
|
-
case 16:
|
|
346
|
-
expect(rejectRecipient).toBeCalled();
|
|
347
|
-
|
|
348
|
-
case 17:
|
|
349
|
-
case "end":
|
|
350
|
-
return _context13.stop();
|
|
351
|
-
}
|
|
268
|
+
}, _callee9);
|
|
269
|
+
})));
|
|
270
|
+
|
|
271
|
+
case 6:
|
|
272
|
+
verifyButton = getByText('Verify');
|
|
273
|
+
_context13.next = 9;
|
|
274
|
+
return act( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
275
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
276
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
277
|
+
case 0:
|
|
278
|
+
return _context10.abrupt("return", fireEvent.click(verifyButton));
|
|
279
|
+
|
|
280
|
+
case 1:
|
|
281
|
+
case "end":
|
|
282
|
+
return _context10.stop();
|
|
283
|
+
}
|
|
284
|
+
}, _callee10);
|
|
285
|
+
})));
|
|
286
|
+
|
|
287
|
+
case 9:
|
|
288
|
+
rejectButton = getByText('Reject');
|
|
289
|
+
_context13.next = 12;
|
|
290
|
+
return act( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
291
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
292
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
293
|
+
case 0:
|
|
294
|
+
return _context11.abrupt("return", fireEvent.click(rejectButton));
|
|
295
|
+
|
|
296
|
+
case 1:
|
|
297
|
+
case "end":
|
|
298
|
+
return _context11.stop();
|
|
299
|
+
}
|
|
300
|
+
}, _callee11);
|
|
301
|
+
})));
|
|
302
|
+
|
|
303
|
+
case 12:
|
|
304
|
+
expect(getByText("Do you really want to reject contact ".concat(recipientBob.public_name, " (").concat(recipientBob.email, ")?"))).toBeTruthy();
|
|
305
|
+
confirmRejectButton = getByText('Reject');
|
|
306
|
+
_context13.next = 16;
|
|
307
|
+
return act( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
308
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
309
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
310
|
+
case 0:
|
|
311
|
+
return _context12.abrupt("return", fireEvent.click(confirmRejectButton));
|
|
312
|
+
|
|
313
|
+
case 1:
|
|
314
|
+
case "end":
|
|
315
|
+
return _context12.stop();
|
|
316
|
+
}
|
|
317
|
+
}, _callee12);
|
|
318
|
+
})));
|
|
319
|
+
|
|
320
|
+
case 16:
|
|
321
|
+
expect(rejectRecipient).toBeCalled();
|
|
322
|
+
|
|
323
|
+
case 17:
|
|
324
|
+
case "end":
|
|
325
|
+
return _context13.stop();
|
|
352
326
|
}
|
|
353
327
|
}, _callee13);
|
|
354
328
|
})));
|
|
@@ -153,42 +153,40 @@ var ShareDialogTwoStepsConfirmationContainer = function ShareDialogTwoStepsConfi
|
|
|
153
153
|
var getRecipientsToBeConfirmed = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
154
154
|
var result;
|
|
155
155
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
156
|
-
while (1) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
_context.next = 15;
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
setStatus('loading');
|
|
165
|
-
_context.prev = 2;
|
|
166
|
-
_context.next = 5;
|
|
167
|
-
return twoStepsConfirmationMethods.getRecipientsToBeConfirmed();
|
|
168
|
-
|
|
169
|
-
case 5:
|
|
170
|
-
result = _context.sent;
|
|
171
|
-
setRecipientsToBeConfirmed(result);
|
|
172
|
-
setStatus('sharing');
|
|
173
|
-
_context.next = 13;
|
|
156
|
+
while (1) switch (_context.prev = _context.next) {
|
|
157
|
+
case 0:
|
|
158
|
+
if (!shouldGetRecipientsToBeConfirmed) {
|
|
159
|
+
_context.next = 15;
|
|
174
160
|
break;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
setStatus('loading');
|
|
164
|
+
_context.prev = 2;
|
|
165
|
+
_context.next = 5;
|
|
166
|
+
return twoStepsConfirmationMethods.getRecipientsToBeConfirmed();
|
|
167
|
+
|
|
168
|
+
case 5:
|
|
169
|
+
result = _context.sent;
|
|
170
|
+
setRecipientsToBeConfirmed(result);
|
|
171
|
+
setStatus('sharing');
|
|
172
|
+
_context.next = 13;
|
|
173
|
+
break;
|
|
174
|
+
|
|
175
|
+
case 10:
|
|
176
|
+
_context.prev = 10;
|
|
177
|
+
_context.t0 = _context["catch"](2);
|
|
178
|
+
setStatus('error');
|
|
179
|
+
|
|
180
|
+
case 13:
|
|
181
|
+
_context.next = 16;
|
|
182
|
+
break;
|
|
183
|
+
|
|
184
|
+
case 15:
|
|
185
|
+
setStatus('sharing');
|
|
186
|
+
|
|
187
|
+
case 16:
|
|
188
|
+
case "end":
|
|
189
|
+
return _context.stop();
|
|
192
190
|
}
|
|
193
191
|
}, _callee, null, [[2, 10]]);
|
|
194
192
|
})), [shouldGetRecipientsToBeConfirmed, twoStepsConfirmationMethods, setRecipientsToBeConfirmed, setStatus]);
|