mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[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:
@@ -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');
|
||||
|
Reference in New Issue
Block a user