mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
unit test performance (#3194)
* DataTable (-4 sec) * PaginationComponent (-1 sec) * DocumentList * custom testbed setup, test upgrades * test fixes * more test fixes * remove fdescribe * test fixes * test fixes * more test fixes * test fixes * upgrade tests * update tests * upgrade tests * upgrade tests * upgrade tests * upgrade tests * update tests * translate loader fixes * auth and cookie fixes * upgrade tests * upgrade tests * test fixes * almost there * diable broken tests * process tests (part 1) * fix lint issues * another test upgrade * almost there * cleanup * insights testing upgrade * improve tests * tests cleanup * tests cleanup * cleanup tests * test cleanup * favorite nodes tests * rebase fix syntax * fix core test * give up test focus * flush tabs * fix search test * Update document-list.component.spec.ts * fix document list lock * increase tick time * remove duplicate test
This commit is contained in:
committed by
Eugenio Romano
parent
9fbfcfa96e
commit
382ea3c1b3
@@ -29,7 +29,7 @@ import 'rxjs/observable/forkJoin';
|
||||
exportAs: 'adfFavorite'
|
||||
})
|
||||
export class NodeFavoriteDirective implements OnChanges {
|
||||
private favorites: any[] = [];
|
||||
favorites: any[] = [];
|
||||
|
||||
/** Array of nodes to toggle as favorites. */
|
||||
@Input('adf-node-favorite')
|
||||
@@ -68,7 +68,7 @@ export class NodeFavoriteDirective implements OnChanges {
|
||||
// shared files have nodeId
|
||||
const id = selected.entry.nodeId || selected.entry.id;
|
||||
|
||||
return Observable.fromPromise(this.alfrescoApiService.getInstance().core.favoritesApi.removeFavoriteSite('-me-', id));
|
||||
return Observable.fromPromise(this.alfrescoApiService.favoritesApi.removeFavoriteSite('-me-', id));
|
||||
});
|
||||
|
||||
Observable.forkJoin(batch).subscribe(() => {
|
||||
@@ -81,7 +81,7 @@ export class NodeFavoriteDirective implements OnChanges {
|
||||
const notFavorite = this.favorites.filter((node) => !node.entry.isFavorite);
|
||||
const body: FavoriteBody[] = notFavorite.map((node) => this.createFavoriteBody(node));
|
||||
|
||||
Observable.fromPromise(this.alfrescoApiService.getInstance().core.favoritesApi.addFavorite('-me-', <any> body))
|
||||
Observable.fromPromise(this.alfrescoApiService.favoritesApi.addFavorite('-me-', <any> body))
|
||||
.subscribe(() => {
|
||||
notFavorite.map(selected => selected.entry.isFavorite = true);
|
||||
this.toggle.emit();
|
||||
@@ -98,7 +98,9 @@ export class NodeFavoriteDirective implements OnChanges {
|
||||
const result = this.diff(selection, this.favorites);
|
||||
const batch = this.getProcessBatch(result);
|
||||
|
||||
Observable.forkJoin(batch).subscribe((data) => this.favorites.push(...data));
|
||||
Observable.forkJoin(batch).subscribe((data) => {
|
||||
this.favorites.push(...data);
|
||||
});
|
||||
}
|
||||
|
||||
hasFavorites(): boolean {
|
||||
@@ -118,8 +120,7 @@ export class NodeFavoriteDirective implements OnChanges {
|
||||
// shared files have nodeId
|
||||
const id = (<any> selected).entry.nodeId || selected.entry.id;
|
||||
|
||||
const promise = this.alfrescoApiService.getInstance()
|
||||
.core.favoritesApi.getFavorite('-me-', id);
|
||||
const promise = this.alfrescoApiService.favoritesApi.getFavorite('-me-', id);
|
||||
|
||||
return Observable.from(promise)
|
||||
.map(() => ({
|
||||
|
Reference in New Issue
Block a user