mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-06-16 17:54:45 +00:00
tests
This commit is contained in:
parent
88e6f98ed2
commit
cdcc770e24
@ -26,7 +26,10 @@ import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|||||||
import { InfoDrawerComponent } from './info-drawer.component';
|
import { InfoDrawerComponent } from './info-drawer.component';
|
||||||
import { TestBed, ComponentFixture, async } from '@angular/core/testing';
|
import { TestBed, ComponentFixture, async } from '@angular/core/testing';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { SetInfoDrawerStateAction } from '@alfresco/aca-shared/store';
|
import {
|
||||||
|
SetInfoDrawerStateAction,
|
||||||
|
ToggleInfoDrawerAction
|
||||||
|
} from '@alfresco/aca-shared/store';
|
||||||
import { AppTestingModule } from '../../testing/app-testing.module';
|
import { AppTestingModule } from '../../testing/app-testing.module';
|
||||||
import { AppExtensionService } from '../../extensions/extension.service';
|
import { AppExtensionService } from '../../extensions/extension.service';
|
||||||
import { ContentApiService } from '@alfresco/aca-shared';
|
import { ContentApiService } from '@alfresco/aca-shared';
|
||||||
@ -159,4 +162,23 @@ describe('InfoDrawerComponent', () => {
|
|||||||
expect(component.displayNode).toBe(response);
|
expect(component.displayNode).toBe(response);
|
||||||
expect(contentApiService.getNodeInfo).toHaveBeenCalled();
|
expect(contentApiService.getNodeInfo).toHaveBeenCalled();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it('should dispatch close panel on Esc keyboard event', () => {
|
||||||
|
const nodeMock = <any>{ entry: { id: 'nodeId', aspectNames: [] } };
|
||||||
|
component.node = nodeMock;
|
||||||
|
const event = new KeyboardEvent('keydown', {
|
||||||
|
code: 'Escape',
|
||||||
|
key: 'Escape',
|
||||||
|
keyCode: 27
|
||||||
|
} as KeyboardEventInit);
|
||||||
|
|
||||||
|
fixture.detectChanges();
|
||||||
|
component.ngOnChanges();
|
||||||
|
|
||||||
|
fixture.debugElement.nativeElement.dispatchEvent(event);
|
||||||
|
|
||||||
|
expect(storeMock.dispatch).toHaveBeenCalledWith(
|
||||||
|
new ToggleInfoDrawerAction()
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user