mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
Bump prettier from 2.0.5 to 2.1.0 (#1632)
* Bump prettier from 2.0.5 to 2.1.0 Bumps [prettier](https://github.com/prettier/prettier) from 2.0.5 to 2.1.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.0.5...2.1.0) Signed-off-by: dependabot[bot] <support@github.com> * fix lint Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Denys Vuika <denys.vuika@gmail.com>
This commit is contained in:
@@ -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: `
|
||||
<button #favoriteLibrary="favoriteLibrary" [acaFavoriteLibrary]="selection">
|
||||
Favorite
|
||||
</button>
|
||||
`
|
||||
template: ` <button #favoriteLibrary="favoriteLibrary" [acaFavoriteLibrary]="selection">Favorite</button> `
|
||||
})
|
||||
class TestComponent {
|
||||
@ViewChild('favoriteLibrary')
|
||||
@@ -45,10 +41,10 @@ class TestComponent {
|
||||
}
|
||||
|
||||
describe('LibraryFavoriteDirective', () => {
|
||||
let fixture;
|
||||
let api;
|
||||
let component;
|
||||
let selection;
|
||||
let fixture: ComponentFixture<TestComponent>;
|
||||
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();
|
||||
|
Reference in New Issue
Block a user