[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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 2 deletions

View File

@ -24,9 +24,49 @@
*/ */
import { AppHeaderComponent } from './header.component'; 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', () => { describe('AppHeaderComponent', () => {
it('should be defined', () => { let component: AppHeaderComponent;
expect(AppHeaderComponent).toBeDefined();
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);
}); });
}); });

View File

@ -0,0 +1,9 @@
@mixin toolbar-actions-theme($theme) {
$foreground: map-get($theme, foreground);
app-toolbar-button,
app-toolbar-menu,
adf-dynamic-component {
color: mat-color($foreground, text, 0.72);
}
}

View File

@ -13,6 +13,7 @@
@import '../components/create-menu/create-menu.component.scss'; @import '../components/create-menu/create-menu.component.scss';
@import '../components/layout/layout.theme.scss'; @import '../components/layout/layout.theme.scss';
@import '../dialogs/node-template/create-from-template.dialog.scss'; @import '../dialogs/node-template/create-from-template.dialog.scss';
@import '../components/toolbar/toolbar-action/toolbar-actions.component.scss';
@import './overrides/adf-style-fixes.theme'; @import './overrides/adf-style-fixes.theme';
@ -50,6 +51,7 @@ $warn: map-get($custom-theme, warn);
@include aca-custom-name-column-theme($theme); @include aca-custom-name-column-theme($theme);
@include app-create-from-template-theme($theme); @include app-create-from-template-theme($theme);
@include app-create-menu-theme($theme); @include app-create-menu-theme($theme);
@include toolbar-actions-theme($theme);
@include adf-style-fixes($theme); @include adf-style-fixes($theme);
.mat-toolbar { .mat-toolbar {