[ACA-1894] - added the possibility to filter whenever is possible by … (#5633)

* [ACA-1894] - added the possibility to filter whenever is possible by file path

* [ACA-1894] - fixed linting

* [ACA-1894] - reverted dynamic app config service refresh

* [ACA-1894] - added extra example in upload docs

* Update upload.service.md

Co-authored-by: Eugenio Romano <eromano@users.noreply.github.com>
This commit is contained in:
Vito
2020-04-24 14:25:49 +01:00
committed by GitHub
parent b9842ba12b
commit 6fea3b8cdd
5 changed files with 251 additions and 43 deletions

View File

@@ -47,6 +47,13 @@ describe('UploadService', () => {
/* cspell:disable-next-line */
nocase: true
}
},
folders: {
excluded: ['ROLLINGPANDA'],
'match-options': {
/* cspell:disable-next-line */
nocase: true
}
}
};
@@ -319,6 +326,22 @@ describe('UploadService', () => {
expect(result[0]).toBe(file4);
});
it('should skip files if they are in an excluded folder', () => {
const file1: any = { name: 'readmetoo.md', file : { webkitRelativePath: '/rollingPanda/' }};
const file2: any = { name: 'readme.md', file : { webkitRelativePath: '/test/' }};
const result = service.addToQueue(file1, file2);
expect(result.length).toBe(1);
expect(result[0]).toBe(file2);
});
it('should match the folder in case insensitive way', () => {
const file1: any = { name: 'readmetoo.md', file : { webkitRelativePath: '/rollingPanda/' }};
const file2: any = { name: 'readme.md', file : { webkitRelativePath: '/test/' }};
const result = service.addToQueue(file1, file2);
expect(result.length).toBe(1);
expect(result[0]).toBe(file2);
});
it('should call onUploadDeleted if file was deleted', async(() => {
const file = <any> ({ status: FileUploadStatus.Deleted });
spyOn(service.fileUploadDeleted, 'next');