Skip to content

Commit

Permalink
Fix pipeline for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikiwanekhyland committed Nov 9, 2023
1 parent 723ebec commit 6aec5c9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
6 changes: 3 additions & 3 deletions app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';

import { TRANSLATION_PROVIDER, AppConfigService, DebugAppConfigService, CoreModule, AuthGuard } from '@alfresco/adf-core';
import { TRANSLATION_PROVIDER, AppConfigService, DebugAppConfigService, CoreModule, AuthGuard, AuthModule } from '@alfresco/adf-core';
import { AppService } from '@alfresco/aca-shared';

import { AppExtensionsModule } from './extensions.module';
Expand Down Expand Up @@ -102,7 +101,8 @@ registerLocaleData(localeSv);
ShellModule.withRoutes({
shellChildren: [CONTENT_LAYOUT_ROUTES]
}),
ContentServiceExtensionModule
ContentServiceExtensionModule,
AuthModule.forRoot({ useHash: true })
],
providers: [
{ provide: AppService, useClass: AppService },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { Injector } from '@angular/core';
import { Store } from '@ngrx/store';
import { of } from 'rxjs';
import { CoreModule, UserPreferencesService } from '@alfresco/adf-core';
import { LibTestingModule } from '@alfresco/aca-shared';
import { ContextMenuService } from './context-menu.service';
import { TranslateModule } from '@ngx-translate/core';
import { ContextMenuComponent } from './context-menu.component';
Expand All @@ -51,7 +52,7 @@ describe('ContextMenuService', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [TranslateModule.forRoot(), CoreModule.forRoot(), ContextMenuComponent],
imports: [TranslateModule.forRoot(), CoreModule.forRoot(), ContextMenuComponent, LibTestingModule],
providers: [Overlay, { provide: Store, useValue: { select: () => of() } }, UserPreferencesService]
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import { TestBed, ComponentFixture } from '@angular/core/testing';
import { PageComponent } from './document-base-page.component';
import { ReloadDocumentListAction, SetSelectedNodesAction, AppState, ViewNodeAction } from '@alfresco/aca-shared/store';
import { AppExtensionService } from '@alfresco/aca-shared';
import { AppExtensionService, LibTestingModule } from '@alfresco/aca-shared';
import { NodeEntry, NodePaging, RepositoryInfo, VersionInfo } from '@alfresco/js-api';
import { DocumentBasePageService } from './document-base-page.service';
import { Store, StoreModule } from '@ngrx/store';
Expand All @@ -37,7 +37,7 @@ import { HttpClientModule } from '@angular/common/http';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';
import { EffectsModule } from '@ngrx/effects';
import { BehaviorSubject, Observable, Subscription, of } from 'rxjs';
import { BehaviorSubject, Observable, Subscription, of, throwError } from 'rxjs';

export const INITIAL_APP_STATE: AppState = {
appName: 'Alfresco Content Application',
Expand Down Expand Up @@ -125,6 +125,7 @@ describe('PageComponent', () => {
}
),
EffectsModule.forRoot([]),
LibTestingModule,
PipeModule
],
declarations: [TestComponent],
Expand Down Expand Up @@ -336,12 +337,15 @@ describe('Info Drawer state', () => {
window.history.pushState({}, null, `${locationHref}#test`);
fixture.detectChanges();

fixture.whenStable().then(() => {
component.infoDrawerOpened$.subscribe((state) => {
expect(state).toBe(true);
done();
});
});
fixture
.whenStable()
.then(() => {
component.infoDrawerOpened$.subscribe((state) => {
expect(state).toBe(true);
done();
});
})
.catch(() => throwError({}));

store.setState({
app: {
Expand All @@ -355,12 +359,15 @@ describe('Info Drawer state', () => {
window.history.pushState({}, null, `${locationHref}#test(viewer:view)`);
fixture.detectChanges();

fixture.whenStable().then(() => {
component.infoDrawerOpened$.subscribe((state) => {
expect(state).toBe(true);
done();
});
});
fixture
.whenStable()
.then(() => {
component.infoDrawerOpened$.subscribe((state) => {
expect(state).toBe(true);
done();
});
})
.catch(() => throwError({}));

store.setState({
app: {
Expand Down
4 changes: 3 additions & 1 deletion projects/aca-shared/src/lib/testing/lib-testing-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import {
AlfrescoApiService,
AlfrescoApiServiceMock,
AuthenticationService,
PipeModule,
TranslateLoaderService,
TranslationMock,
Expand Down Expand Up @@ -103,7 +104,8 @@ export const initialState = {
exports: [TranslateModule],
providers: [
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
{ provide: TranslationService, useClass: TranslationMock }
{ provide: TranslationService, useClass: TranslationMock },
{ provide: AuthenticationService, useValue: { getToken: () => 'fake token' } }
]
})
export class LibTestingModule {}

0 comments on commit 6aec5c9

Please sign in to comment.