[ACA-3278] Header - extension actions not visible (#1462)

* custom toolbar actions theme

* update  tests
This commit is contained in:
Cilibiu Bogdan
2020-05-12 08:53:30 +03:00
committed by GitHub
parent 03a1a5c0e9
commit 7b0ce29000
3 changed files with 53 additions and 2 deletions

View File

@@ -24,9 +24,49 @@
*/
import { AppHeaderComponent } from './header.component';
import { AppState } from '@alfresco/aca-shared/store';
import { of } from 'rxjs';
import { async } from '@angular/core/testing';
import { ContentActionRef } from '@alfresco/adf-extensions';
describe('AppHeaderComponent', () => {
it('should be defined', () => {
expect(AppHeaderComponent).toBeDefined();
let component: AppHeaderComponent;
const actions = [
{ id: 'action-1', type: 'button' },
{ id: 'action-2', type: 'button' }
] as Array<ContentActionRef>;
const store = {
select: jasmine.createSpy('select')
} as any;
const appExtensionService = {
getHeaderActions: () => actions
} as any;
const app = {
headerColor: 'some-color',
appName: 'name',
logoPath: 'some/path'
} as AppState;
beforeEach(() => {
store.select.and.callFake(memoizeFn => {
return of(memoizeFn({ app }));
});
component = new AppHeaderComponent(store, appExtensionService);
});
it('should set header color, name and logo', async(() => {
component.appName$.subscribe(val => expect(val).toBe(app.appName));
component.logo$.subscribe(val => expect(val).toBe(app.logoPath));
component.headerColor$.subscribe(val => expect(val).toBe(app.headerColor));
}));
it('should get header actions', () => {
component.ngOnInit();
expect(component.actions).toEqual(actions);
});
});