mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
stabilise unit tests (#1878)
* cleanup async usage * cleanup async usage * fix library favorite tests and code
This commit is contained in:
@@ -28,7 +28,6 @@ import { AppTestingModule } from '../../testing/app-testing.module';
|
||||
import { ContextMenuComponent } from './context-menu.component';
|
||||
import { ContextMenuModule } from './context-menu.module';
|
||||
import { ContextMenuOverlayRef } from './context-menu-overlay';
|
||||
import { TranslateModule, TranslateLoader, TranslateFakeLoader } from '@ngx-translate/core';
|
||||
import { ContentActionType } from '@alfresco/adf-extensions';
|
||||
|
||||
import { of } from 'rxjs';
|
||||
@@ -52,15 +51,8 @@ describe('ContextMenuComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
AppTestingModule,
|
||||
ContextMenuModule,
|
||||
TranslateModule.forRoot({
|
||||
loader: { provide: TranslateLoader, useClass: TranslateFakeLoader }
|
||||
})
|
||||
],
|
||||
imports: [ContextMenuModule, AppTestingModule],
|
||||
providers: [
|
||||
AppExtensionService,
|
||||
{
|
||||
provide: ContextMenuOverlayRef,
|
||||
useValue: {
|
||||
@@ -103,11 +95,11 @@ describe('ContextMenuComponent', () => {
|
||||
expect(contextMenuElements[0].querySelector('span').innerText).toBe(contextItem.title);
|
||||
}));
|
||||
|
||||
it('should run action with provided action id', fakeAsync(() => {
|
||||
it('should run action with provided action id', () => {
|
||||
spyOn(extensionsService, 'runActionById');
|
||||
|
||||
component.runAction(contextItem.actions.click);
|
||||
|
||||
expect(extensionsService.runActionById).toHaveBeenCalledWith(contextItem.actions.click);
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user