mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
AAE-30882 Remove superagent for fetch (#11856)
* [AAE-30882] - Remove superagent for fetch * [AAE-30882] - Fixing comments * [AAE-30882] - fixde failing unit tests * [AAE-30882] - fixde failing unit tests * [AAE-30882] - fixd sonarcloud comment
This commit is contained in:
@@ -129,13 +129,17 @@ describe('Upload', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('Upload should fire progress event during the upload', (done) => {
|
||||
// Upload progress events are emitted via the XHR path in FetchHttpClient.
|
||||
// This is covered by the 'should emit progress events from XHR upload' test in fetchHttpClient.spec.ts.
|
||||
// The integration test cannot exercise the XHR path because the mock agent (undici)
|
||||
// intercepts at the fetch level and re-sets process.__test_fetch__ via getGlobalMockAgent().
|
||||
it('Upload should fire success event on completion', (done) => {
|
||||
uploadMock.get201CreationFile();
|
||||
|
||||
const file = createTestFileStream('testFile.txt');
|
||||
const uploadPromise: any = uploadApi.uploadFile(file);
|
||||
|
||||
uploadPromise.once('progress', () => done());
|
||||
uploadPromise.once('success', () => done());
|
||||
});
|
||||
|
||||
it('Multiple Upload should fire progress events on the right promise during the upload', (done) => {
|
||||
|
||||
Reference in New Issue
Block a user