diff --git a/package-lock.json b/package-lock.json
index 41a97f3b2..0dd5f028a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13614,9 +13614,9 @@
"dev": true
},
"prettier": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz",
- "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.0.tgz",
+ "integrity": "sha512-lz28cCbA1cDFHVuY8vvj6QuqOwIpyIfPUYkSl8AZ/vxH8qBXMMjE2knfLHCrZCmUsK/H1bg1P0tOo0dJkTJHvw==",
"dev": true
},
"process": {
diff --git a/package.json b/package.json
index a315603c1..e5ec11c67 100644
--- a/package.json
+++ b/package.json
@@ -105,7 +105,7 @@
"lint-staged": "^10.2.11",
"ng-packagr": "^10.0.4",
"node-stream-zip": "^1.11.3",
- "prettier": "^2.0.5",
+ "prettier": "^2.1.0",
"protractor": "^7.0.0",
"protractor-retry": "^1.2.13",
"protractor-smartrunner": "^0.1.1",
diff --git a/src/app/directives/library-favorite.directive.spec.ts b/src/app/directives/library-favorite.directive.spec.ts
index bc6f9635e..75407f15e 100644
--- a/src/app/directives/library-favorite.directive.spec.ts
+++ b/src/app/directives/library-favorite.directive.spec.ts
@@ -26,16 +26,12 @@
import { Component, ViewChild } from '@angular/core';
import { LibraryFavoriteDirective } from './library-favorite.directive';
import { AlfrescoApiService, AlfrescoApiServiceMock, setupTestBed, CoreModule } from '@alfresco/adf-core';
-import { TestBed, async } from '@angular/core/testing';
+import { TestBed, async, ComponentFixture } from '@angular/core/testing';
import { TranslateModule } from '@ngx-translate/core';
@Component({
selector: 'app-test-component',
- template: `
-
- `
+ template: ` `
})
class TestComponent {
@ViewChild('favoriteLibrary')
@@ -45,10 +41,10 @@ class TestComponent {
}
describe('LibraryFavoriteDirective', () => {
- let fixture;
- let api;
- let component;
- let selection;
+ let fixture: ComponentFixture;
+ let api: AlfrescoApiService;
+ let component: TestComponent;
+ let selection: { entry: { guid: string; id: string } };
setupTestBed({
imports: [TranslateModule.forRoot(), CoreModule.forRoot()],
@@ -76,7 +72,7 @@ describe('LibraryFavoriteDirective', () => {
});
it('should mark selection as favorite when getFavoriteSite returns successfully', async(() => {
- spyOn(api.peopleApi, 'getFavoriteSite').and.returnValue(Promise.resolve());
+ spyOn(api.peopleApi, 'getFavoriteSite').and.returnValue(Promise.resolve(null));
component.selection = selection;
fixture.detectChanges();
@@ -99,7 +95,7 @@ describe('LibraryFavoriteDirective', () => {
it('should call addFavorite() on click event when selection is not a favorite', async(() => {
spyOn(api.peopleApi, 'getFavoriteSite').and.returnValue(Promise.reject());
- spyOn(api.peopleApi, 'addFavorite').and.returnValue(Promise.resolve());
+ spyOn(api.peopleApi, 'addFavorite').and.returnValue(Promise.resolve(null));
component.selection = selection;
fixture.detectChanges();
@@ -115,7 +111,7 @@ describe('LibraryFavoriteDirective', () => {
}));
it('should call removeFavoriteSite() on click event when selection is not a favorite', async(() => {
- spyOn(api.peopleApi, 'getFavoriteSite').and.returnValue(Promise.resolve());
+ spyOn(api.peopleApi, 'getFavoriteSite').and.returnValue(Promise.resolve(null));
spyOn(api.favoritesApi, 'removeFavoriteSite').and.returnValue(Promise.resolve());
component.selection = selection;
fixture.detectChanges();