mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-24 14:31:41 +00:00
fix modules
This commit is contained in:
@@ -137,15 +137,17 @@ describe('PeopleContentService', () => {
|
||||
expect(getCurrentPersonSpy.calls.count()).toEqual(1);
|
||||
});
|
||||
|
||||
it('should reset the admin cache upon logout', async () => {
|
||||
it('should reset the admin cache upon logout', async (done) => {
|
||||
spyOn(peopleContentService.peopleApi, 'getPerson').and.returnValue(Promise.resolve({ entry: fakeEcmAdminUser } as any));
|
||||
|
||||
const user = await peopleContentService.getCurrentUserInfo().toPromise();
|
||||
expect(user.id).toEqual('fake-id');
|
||||
expect(peopleContentService.isCurrentUserAdmin()).toBe(true);
|
||||
|
||||
authenticationService.onLogout.next(true);
|
||||
expect(peopleContentService.isCurrentUserAdmin()).toBe(false);
|
||||
authenticationService.onLogout.subscribe(()=>{
|
||||
expect(peopleContentService.isCurrentUserAdmin()).toBe(false);
|
||||
done()
|
||||
});
|
||||
});
|
||||
|
||||
it('should not change current user on every getPerson call', async () => {
|
||||
|
@@ -27,7 +27,8 @@ import {
|
||||
AlfrescoApiServiceMock,
|
||||
AppConfigServiceMock,
|
||||
TranslationMock,
|
||||
CookieServiceMock
|
||||
CookieServiceMock,
|
||||
AuthModule
|
||||
} from '@alfresco/adf-core';
|
||||
import { ContentModule } from '../content.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -37,6 +38,7 @@ import { MatIconTestingModule } from '@angular/material/icon/testing';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
AuthModule.forRoot({ useHash: true }),
|
||||
NoopAnimationsModule,
|
||||
RouterTestingModule,
|
||||
TranslateModule,
|
||||
|
@@ -32,9 +32,11 @@ import { CookieServiceMock } from '../mock/cookie.service.mock';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { directionalityConfigFactory } from '../common/services/directionality-config-factory';
|
||||
import { DirectionalityConfigService } from '../common/services/directionality-config.service';
|
||||
import { AuthModule } from "../auth";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
AuthModule.forRoot({ useHash: true }),
|
||||
NoopAnimationsModule,
|
||||
RouterTestingModule,
|
||||
HttpClientModule,
|
||||
|
@@ -26,11 +26,12 @@ import {
|
||||
AppConfigServiceMock,
|
||||
TranslationService,
|
||||
TranslationMock,
|
||||
CoreModule
|
||||
CoreModule, AuthModule
|
||||
} from '@alfresco/adf-core';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
AuthModule.forRoot({ useHash: true }),
|
||||
NoopAnimationsModule,
|
||||
TranslateModule,
|
||||
CoreModule,
|
||||
|
@@ -25,7 +25,7 @@ import {
|
||||
AppConfigServiceMock,
|
||||
TranslationService,
|
||||
TranslationMock,
|
||||
CoreModule
|
||||
CoreModule, AuthModule
|
||||
} from '@alfresco/adf-core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ProcessServicesCloudModule } from '../process-services-cloud.module';
|
||||
@@ -33,6 +33,7 @@ import { RouterTestingModule } from '@angular/router/testing';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
AuthModule.forRoot({ useHash: true }),
|
||||
HttpClientModule,
|
||||
NoopAnimationsModule,
|
||||
RouterTestingModule,
|
||||
|
@@ -26,7 +26,7 @@ import {
|
||||
TranslationService,
|
||||
TranslationMock,
|
||||
CoreModule,
|
||||
FormRenderingService
|
||||
FormRenderingService, AuthModule
|
||||
} from '@alfresco/adf-core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ProcessFormRenderingService } from '../form/process-form-rendering.service';
|
||||
@@ -34,6 +34,7 @@ import { RouterTestingModule } from '@angular/router/testing';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
AuthModule.forRoot({ useHash: true }),
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
|
Reference in New Issue
Block a user