mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[ADF-2569] fix reload app.config.json (#3124)
* fix reload app.config.json * improve style mobile fix test * test karma setup update * fix core providers test * remove unused providers * use mock api in service test * skip test in the wrong place * remove comma * remove fdescribe
This commit is contained in:
committed by
Denys Vuika
parent
21b8cd30ce
commit
9e2969b955
@@ -16,24 +16,15 @@
|
||||
*/
|
||||
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { APP_INITIALIZER, NgModule } from '@angular/core';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { AppConfigService } from './app-config.service';
|
||||
import { startupServiceFactory } from './startup-service-factory';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
HttpClientModule
|
||||
],
|
||||
providers: [
|
||||
AppConfigService,
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: startupServiceFactory,
|
||||
deps: [
|
||||
AppConfigService
|
||||
],
|
||||
multi: true
|
||||
}
|
||||
AppConfigService
|
||||
]
|
||||
})
|
||||
export class AppConfigModule {
|
||||
|
@@ -54,6 +54,7 @@ describe('AppConfigService', () => {
|
||||
beforeEach(
|
||||
inject([AppConfigService], (appConfig: AppConfigService) => {
|
||||
appConfigService = appConfig;
|
||||
appConfigService.load();
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
'status': 200,
|
||||
|
@@ -31,7 +31,7 @@ export class AppConfigService {
|
||||
ecmHost: 'http://{hostname}{:port}/ecm',
|
||||
bpmHost: 'http://{hostname}{:port}/bpm',
|
||||
logLevel: 'silent',
|
||||
alfrescoRepositoryName : 'alfresco-1'
|
||||
alfrescoRepositoryName: 'alfresco-1'
|
||||
};
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
@@ -60,8 +60,8 @@ export class AppConfigService {
|
||||
return location.port ? prefix + location.port : '';
|
||||
}
|
||||
|
||||
async load(): Promise<any> {
|
||||
await new Promise(resolve => {
|
||||
load(): Promise<any> {
|
||||
return new Promise(resolve => {
|
||||
this.http.get('app.config.json').subscribe(
|
||||
(data: any) => {
|
||||
this.config = Object.assign({}, this.config, data || {});
|
||||
|
@@ -23,9 +23,7 @@ import { MatCheckboxChange, MatCheckbox } from '@angular/material';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { AppConfigService } from '../../../app-config/app-config.service';
|
||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
||||
import { LogService } from '../../../services/log.service';
|
||||
import { TranslateLoaderService } from '../../../services/translate-loader.service';
|
||||
|
||||
import { CardViewBoolItemComponent } from './card-view-boolitem.component';
|
||||
@@ -54,9 +52,7 @@ describe('CardViewBoolItemComponent', () => {
|
||||
CardViewBoolItemComponent
|
||||
],
|
||||
providers: [
|
||||
AppConfigService,
|
||||
CardViewUpdateService,
|
||||
LogService
|
||||
CardViewUpdateService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -22,7 +22,6 @@ import { MatDatetimepickerModule, MatNativeDatetimeModule } from '@mat-datetimep
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import moment from 'moment-es6';
|
||||
import { AppConfigService } from '../../../index';
|
||||
import { CardViewDateItemModel } from '../../models/card-view-dateitem.model';
|
||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
||||
import { TranslateLoaderService } from '../../../services/translate-loader.service';
|
||||
@@ -54,8 +53,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
CardViewDateItemComponent
|
||||
],
|
||||
providers: [
|
||||
CardViewUpdateService,
|
||||
AppConfigService
|
||||
CardViewUpdateService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -46,7 +46,6 @@ describe('CardViewItemDispatcherComponent', () => {
|
||||
cardItemTypeService.setComponentTypeResolver('shiny-custom-element', () => CardViewShinyCustomElementItemComponent);
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
imports: [],
|
||||
declarations: [
|
||||
CardViewItemDispatcherComponent,
|
||||
CardViewShinyCustomElementItemComponent,
|
||||
|
@@ -24,9 +24,7 @@ import { By } from '@angular/platform-browser';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { CardViewMapItemModel } from '../../models/card-view-mapitem.model';
|
||||
import { AppConfigService } from '../../../app-config/app-config.service';
|
||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
||||
import { LogService } from '../../../services/log.service';
|
||||
import { TranslateLoaderService } from '../../../services/translate-loader.service';
|
||||
|
||||
import { CardViewMapItemComponent } from './card-view-mapitem.component';
|
||||
@@ -57,9 +55,7 @@ describe('CardViewMapItemComponent', () => {
|
||||
CardViewMapItemComponent
|
||||
],
|
||||
providers: [
|
||||
AppConfigService,
|
||||
CardViewUpdateService,
|
||||
LogService
|
||||
CardViewUpdateService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -23,9 +23,7 @@ import { By } from '@angular/platform-browser';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { CardViewTextItemModel } from '../../models/card-view-textitem.model';
|
||||
import { AppConfigService } from '../../../app-config/app-config.service';
|
||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
||||
import { LogService } from '../../../services/log.service';
|
||||
import { TranslateLoaderService } from '../../../services/translate-loader.service';
|
||||
|
||||
import { CardViewTextItemComponent } from './card-view-textitem.component';
|
||||
@@ -56,9 +54,7 @@ describe('CardViewTextItemComponent', () => {
|
||||
CardViewTextItemComponent
|
||||
],
|
||||
providers: [
|
||||
AppConfigService,
|
||||
CardViewUpdateService,
|
||||
LogService
|
||||
CardViewUpdateService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -25,7 +25,6 @@ import { By } from '@angular/platform-browser';
|
||||
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
|
||||
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { AppConfigService } from '../../../app-config/app-config.service';
|
||||
|
||||
import { CardViewDateItemModel } from '../../models/card-view-dateitem.model';
|
||||
import { CardViewTextItemModel } from '../../models/card-view-textitem.model';
|
||||
@@ -71,8 +70,7 @@ describe('CardViewComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
CardItemTypeService,
|
||||
CardViewUpdateService,
|
||||
AppConfigService
|
||||
CardViewUpdateService
|
||||
]
|
||||
});
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
||||
import { NgModule, ModuleWithProviders } from '@angular/core';
|
||||
import { APP_INITIALIZER, NgModule, ModuleWithProviders } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
||||
|
||||
@@ -75,6 +75,7 @@ import { TranslationService } from './services/translation.service';
|
||||
import { UploadService } from './services/upload.service';
|
||||
import { UserPreferencesService } from './services/user-preferences.service';
|
||||
import { SearchConfigurationService } from './services/search-configuration.service';
|
||||
import { startupServiceFactory } from './services/startup-service-factory';
|
||||
|
||||
export function createTranslateLoader(http: HttpClient, logService: LogService) {
|
||||
return new TranslateLoaderService(http, logService);
|
||||
@@ -241,7 +242,15 @@ export class CoreModuleLazy {
|
||||
TranslateModule
|
||||
],
|
||||
providers: [
|
||||
...providers()
|
||||
...providers(),
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: startupServiceFactory,
|
||||
deps: [
|
||||
AlfrescoApiService
|
||||
],
|
||||
multi: true
|
||||
}
|
||||
]
|
||||
})
|
||||
export class CoreModule {
|
||||
@@ -249,7 +258,15 @@ export class CoreModule {
|
||||
return {
|
||||
ngModule: CoreModule,
|
||||
providers: [
|
||||
...providers()
|
||||
...providers(),
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: startupServiceFactory,
|
||||
deps: [
|
||||
AlfrescoApiService
|
||||
],
|
||||
multi: true
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
|
@@ -87,7 +87,6 @@ describe('NodeleteDirective', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
|
||||
declarations: [
|
||||
TestComponent,
|
||||
TestWithPermissionsComponent,
|
||||
|
@@ -43,7 +43,6 @@ describe('NodeFavoriteDirective', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
|
||||
declarations: [
|
||||
TestComponent
|
||||
]
|
||||
|
@@ -25,7 +25,6 @@ import { FormService } from './../../../services/form.service';
|
||||
import { FormFieldModel } from './../core/form-field.model';
|
||||
import { FormModel } from './../core/form.model';
|
||||
import { DateTimeWidgetComponent } from './date-time.widget';
|
||||
import { UserPreferencesService } from '../../../../services/user-preferences.service';
|
||||
|
||||
describe('DateTimeWidgetComponent', () => {
|
||||
|
||||
@@ -44,7 +43,6 @@ describe('DateTimeWidgetComponent', () => {
|
||||
],
|
||||
providers: [
|
||||
FormService,
|
||||
UserPreferencesService,
|
||||
EcmModelService,
|
||||
ActivitiContentService
|
||||
]
|
||||
|
@@ -31,7 +31,6 @@ describe('WidgetComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [],
|
||||
declarations: [WidgetComponent],
|
||||
providers: [
|
||||
FormService,
|
||||
|
@@ -28,7 +28,6 @@ describe('EcmModelService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [],
|
||||
providers: [
|
||||
EcmModelService
|
||||
]
|
||||
|
@@ -57,7 +57,6 @@ describe('Form service', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [],
|
||||
providers: [
|
||||
EcmModelService,
|
||||
FormService
|
||||
|
@@ -28,7 +28,6 @@ describe('NodeService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [],
|
||||
providers: [
|
||||
NodeService,
|
||||
EcmModelService
|
||||
|
@@ -66,7 +66,6 @@ describe('ProcessContentService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [],
|
||||
providers: [
|
||||
ProcessContentService
|
||||
]
|
||||
|
@@ -37,7 +37,6 @@ describe('WidgetVisibilityService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [],
|
||||
providers: [
|
||||
WidgetVisibilityService
|
||||
]
|
||||
|
@@ -31,8 +31,12 @@ const PipeModule = require('./pipes/pipe.module').PipeModule;
|
||||
const AppConfigModule = require('./app-config/app-config.module').AppConfigModule;
|
||||
const LogService = require('./services/log.service').LogService;
|
||||
const TranslateLoaderService = require('./services/translate-loader.service').TranslateLoaderService;
|
||||
const AppConfigService = require('@alfresco/adf-core').AppConfigService;
|
||||
const AppConfigServiceMock = require('@alfresco/adf-core').AppConfigServiceMock;
|
||||
|
||||
const AppConfigService = require('./app-config/app-config.service').AppConfigService;
|
||||
const AppConfigServiceMock = require('./mock/app-config.service.mock').AppConfigServiceMock;
|
||||
|
||||
const AlfrescoApiServiceMock = require('./mock/alfresco-api.service.mock').AlfrescoApiServiceMock;
|
||||
const AlfrescoApiService = require('./services/alfresco-api.service').AlfrescoApiService;
|
||||
const providers = require('./core.module').providers;
|
||||
|
||||
TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting());
|
||||
@@ -61,7 +65,8 @@ beforeEach(() => {
|
||||
HttpClientModule
|
||||
],
|
||||
providers: [
|
||||
...providers(),
|
||||
providers(),
|
||||
{provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock},
|
||||
{provide: AppConfigService, useClass: AppConfigServiceMock}
|
||||
]});
|
||||
});
|
||||
|
@@ -22,7 +22,6 @@ import { DirectiveModule } from '../directives/directive.module';
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { TranslateLoaderService } from '../services/translate-loader.service';
|
||||
import { UserPreferencesService } from '../services/user-preferences.service';
|
||||
|
||||
import { LanguageMenuComponent } from './language-menu.component';
|
||||
|
||||
@@ -49,8 +48,7 @@ describe('LanguageMenuComponent', () => {
|
||||
LanguageMenuComponent
|
||||
],
|
||||
providers: [
|
||||
AppConfigService,
|
||||
UserPreferencesService
|
||||
AppConfigService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
51
lib/core/mock/alfresco-api.service.mock.ts
Normal file
51
lib/core/mock/alfresco-api.service.mock.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AlfrescoApi } from 'alfresco-js-api';
|
||||
import * as alfrescoApi from 'alfresco-js-api';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { StorageService } from '../services/storage.service';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
|
||||
/* tslint:disable:adf-file-name */
|
||||
@Injectable()
|
||||
export class AlfrescoApiServiceMock extends AlfrescoApiService {
|
||||
|
||||
constructor(protected appConfig: AppConfigService,
|
||||
protected storage: StorageService) {
|
||||
super(appConfig, storage);
|
||||
this.initAlfrescoApi();
|
||||
}
|
||||
|
||||
async reset() {
|
||||
this.initAlfrescoApi();
|
||||
}
|
||||
|
||||
protected initAlfrescoApi() {
|
||||
this.alfrescoApi = <AlfrescoApi> new alfrescoApi({
|
||||
provider: this.storage.getItem('AUTH_TYPE'),
|
||||
ticketEcm: this.storage.getItem('ticket-ECM'),
|
||||
ticketBpm: this.storage.getItem('ticket-BPM'),
|
||||
hostEcm: this.appConfig.get<string>('ecmHost'),
|
||||
hostBpm: this.appConfig.get<string>('bpmHost'),
|
||||
contextRoot: 'alfresco',
|
||||
disableCsrf: this.storage.getItem('DISABLE_CSRF') === 'true',
|
||||
oauth2: this.appConfig.get<any>('oauth2')
|
||||
});
|
||||
}
|
||||
}
|
@@ -27,6 +27,7 @@ export * from './event.mock';
|
||||
export * from './renditionsService.mock';
|
||||
export * from './search.service.mock';
|
||||
export * from './traslation.service.mock';
|
||||
export * from './alfresco-api.service.mock';
|
||||
|
||||
export * from './form/form.component.mock';
|
||||
export * from './form/formDefinition.mock';
|
||||
|
@@ -21,8 +21,6 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { Pagination } from 'alfresco-js-api';
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { LogService } from '../services/log.service';
|
||||
import { TranslateLoaderService } from '../services/translate-loader.service';
|
||||
import { TranslationService } from '../services/translation.service';
|
||||
import { PaginationComponent } from './pagination.component';
|
||||
@@ -68,9 +66,7 @@ describe('PaginationComponent', () => {
|
||||
PaginationComponent
|
||||
],
|
||||
providers: [
|
||||
TranslationService,
|
||||
LogService,
|
||||
AppConfigService
|
||||
TranslationService
|
||||
],
|
||||
schemas: [ NO_ERRORS_SCHEMA ]
|
||||
}).compileComponents()
|
||||
|
@@ -28,7 +28,7 @@ import { StorageService } from './storage.service';
|
||||
@Injectable()
|
||||
export class AlfrescoApiService {
|
||||
|
||||
private alfrescoApi: AlfrescoApi;
|
||||
protected alfrescoApi: AlfrescoApi;
|
||||
|
||||
getInstance(): AlfrescoApi {
|
||||
return this.alfrescoApi;
|
||||
@@ -74,13 +74,21 @@ export class AlfrescoApiService {
|
||||
return this.getInstance().core.classesApi;
|
||||
}
|
||||
|
||||
constructor(private appConfig: AppConfigService,
|
||||
private storage: StorageService) {
|
||||
|
||||
this.reset();
|
||||
constructor(protected appConfig: AppConfigService,
|
||||
protected storage: StorageService) {
|
||||
}
|
||||
|
||||
reset() {
|
||||
async load() {
|
||||
await this.appConfig.load().then(() => {
|
||||
this.initAlfrescoApi();
|
||||
});
|
||||
}
|
||||
|
||||
async reset() {
|
||||
this.initAlfrescoApi();
|
||||
}
|
||||
|
||||
protected initAlfrescoApi() {
|
||||
this.alfrescoApi = <AlfrescoApi> new alfrescoApi({
|
||||
provider: this.storage.getItem('AUTH_TYPE'),
|
||||
ticketEcm: this.storage.getItem('ticket-ECM'),
|
||||
@@ -89,7 +97,7 @@ export class AlfrescoApiService {
|
||||
hostBpm: this.appConfig.get<string>('bpmHost'),
|
||||
contextRoot: 'alfresco',
|
||||
disableCsrf: this.storage.getItem('DISABLE_CSRF') === 'true',
|
||||
oauth2 : this.appConfig.get<any>('oauth2')
|
||||
oauth2: this.appConfig.get<any>('oauth2')
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -16,13 +16,8 @@
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AppConfigServiceMock } from '../mock/app-config.service.mock';
|
||||
import { fakeApps } from '../mock/apps-service.mock';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { AppsProcessService } from './apps-process.service';
|
||||
import { LogService } from './log.service';
|
||||
import { StorageService } from './storage.service';
|
||||
|
||||
declare let jasmine: any;
|
||||
describe('Apps Service', () => {
|
||||
@@ -32,11 +27,7 @@ describe('Apps Service', () => {
|
||||
beforeEach((() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
AppsProcessService,
|
||||
AlfrescoApiService,
|
||||
StorageService,
|
||||
LogService,
|
||||
{provide: AppConfigService, useClass: AppConfigServiceMock}
|
||||
AppsProcessService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -19,17 +19,12 @@ import { async, TestBed } from '@angular/core/testing';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { CookieServiceMock } from './../mock/cookie.service.mock';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { SettingsService } from './settings.service';
|
||||
import { AppConfigModule } from '../app-config/app-config.module';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { AuthGuardBpm } from './auth-guard-bpm.service';
|
||||
import { AuthenticationService } from './authentication.service';
|
||||
import { CookieService } from './cookie.service';
|
||||
import { LogService } from './log.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { TranslateLoaderService } from './translate-loader.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
import { RouterStateSnapshot, Router } from '@angular/router';
|
||||
|
||||
describe('AuthGuardService BPM', () => {
|
||||
@@ -53,13 +48,7 @@ describe('AuthGuardService BPM', () => {
|
||||
],
|
||||
providers: [
|
||||
AuthGuardBpm,
|
||||
SettingsService,
|
||||
AlfrescoApiService,
|
||||
AuthenticationService,
|
||||
StorageService,
|
||||
UserPreferencesService,
|
||||
{ provide: CookieService, useClass: CookieServiceMock },
|
||||
LogService
|
||||
{ provide: CookieService, useClass: CookieServiceMock }
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -21,17 +21,12 @@ import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { CookieServiceMock } from './../mock/cookie.service.mock';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { SettingsService } from './settings.service';
|
||||
import { AppConfigModule } from '../app-config/app-config.module';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { AuthGuard } from './auth-guard.service';
|
||||
import { AuthenticationService } from './authentication.service';
|
||||
import { CookieService } from './cookie.service';
|
||||
import { LogService } from './log.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { TranslateLoaderService } from './translate-loader.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
|
||||
describe('AuthGuardService', () => {
|
||||
let state;
|
||||
@@ -54,13 +49,8 @@ describe('AuthGuardService', () => {
|
||||
],
|
||||
providers: [
|
||||
AuthGuard,
|
||||
SettingsService,
|
||||
AlfrescoApiService,
|
||||
AuthenticationService,
|
||||
UserPreferencesService,
|
||||
StorageService,
|
||||
{ provide: CookieService, useClass: CookieServiceMock },
|
||||
LogService
|
||||
{ provide: CookieService, useClass: CookieServiceMock }
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -19,11 +19,9 @@ import { async, TestBed } from '@angular/core/testing';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { CookieServiceMock } from './../mock/cookie.service.mock';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { SettingsService } from './settings.service';
|
||||
import { AppConfigModule } from '../app-config/app-config.module';
|
||||
import { AuthenticationService } from './authentication.service';
|
||||
import { CookieService } from './cookie.service';
|
||||
import { LogService } from './log.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { TranslateLoaderService } from './translate-loader.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
@@ -49,13 +47,10 @@ describe('AuthenticationService', () => {
|
||||
})
|
||||
],
|
||||
providers: [
|
||||
SettingsService,
|
||||
AlfrescoApiService,
|
||||
AuthenticationService,
|
||||
StorageService,
|
||||
UserPreferencesService,
|
||||
{ provide: CookieService, useClass: CookieServiceMock },
|
||||
LogService
|
||||
{ provide: CookieService, useClass: CookieServiceMock }
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -17,13 +17,9 @@
|
||||
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { CommentProcessModel } from '../models';
|
||||
import { AppConfigServiceMock } from '../mock/app-config.service.mock';
|
||||
import { fakeProcessComment, fakeTasksComment, fakeUser1 } from '../mock/comment-process-service.mock';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { CommentProcessService } from './comment-process.service';
|
||||
import { LogService } from './log.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
|
||||
declare let jasmine: any;
|
||||
describe('Comment ProcessService Service', () => {
|
||||
@@ -34,11 +30,7 @@ describe('Comment ProcessService Service', () => {
|
||||
beforeEach((() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
CommentProcessService,
|
||||
AlfrescoApiService,
|
||||
StorageService,
|
||||
LogService,
|
||||
{provide: AppConfigService, useClass: AppConfigServiceMock}
|
||||
CommentProcessService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -18,14 +18,12 @@
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { CookieServiceMock } from '../mock/cookie.service.mock';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { ContentService } from './content.service';
|
||||
import { SettingsService } from './settings.service';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { AppConfigModule } from '../app-config/app-config.module';
|
||||
import { AuthenticationService } from './authentication.service';
|
||||
import { CookieService } from './cookie.service';
|
||||
import { LogService } from './log.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { TranslateLoaderService } from './translate-loader.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
@@ -55,14 +53,12 @@ describe('ContentService', () => {
|
||||
],
|
||||
declarations: [],
|
||||
providers: [
|
||||
AlfrescoApiService,
|
||||
ContentService,
|
||||
AuthenticationService,
|
||||
SettingsService,
|
||||
StorageService,
|
||||
UserPreferencesService,
|
||||
{provide: CookieService, useClass: CookieServiceMock},
|
||||
LogService
|
||||
{provide: CookieService, useClass: CookieServiceMock}
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -17,14 +17,9 @@
|
||||
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { BpmProductVersionModel, EcmProductVersionModel } from '../models/product-version.model';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { SettingsService } from './settings.service';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { AppConfigModule } from '../app-config/app-config.module';
|
||||
import { AuthenticationService } from './authentication.service';
|
||||
import { DiscoveryApiService } from './discovery-api.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -101,12 +96,7 @@ describe('Discovery Api Service', () => {
|
||||
AppConfigModule
|
||||
],
|
||||
providers: [
|
||||
DiscoveryApiService,
|
||||
AlfrescoApiService,
|
||||
UserPreferencesService,
|
||||
AuthenticationService,
|
||||
SettingsService,
|
||||
StorageService
|
||||
DiscoveryApiService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -17,12 +17,7 @@
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { UserProcessModel } from '../models';
|
||||
import { AppConfigServiceMock } from '../mock/app-config.service.mock';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { LogService } from './log.service';
|
||||
import { PeopleProcessService } from './people-process.service';
|
||||
import { StorageService } from './storage.service';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -49,11 +44,7 @@ describe('PeopleProcessService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
PeopleProcessService,
|
||||
AlfrescoApiService,
|
||||
StorageService,
|
||||
LogService,
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock }
|
||||
PeopleProcessService
|
||||
]
|
||||
});
|
||||
service = TestBed.get(PeopleProcessService);
|
||||
|
@@ -17,12 +17,8 @@
|
||||
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { fakeRedition, fakeReditionCreated, fakeReditionsList } from '../mock/renditionsService.mock';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { SettingsService } from './settings.service';
|
||||
import { AppConfigModule } from '../app-config/app-config.module';
|
||||
import { LogService } from './log.service';
|
||||
import { RenditionsService } from './renditions.service';
|
||||
import { StorageService } from './storage.service';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -34,14 +30,8 @@ describe('RenditionsService', () => {
|
||||
imports: [
|
||||
AppConfigModule
|
||||
],
|
||||
declarations: [
|
||||
],
|
||||
providers: [
|
||||
AlfrescoApiService,
|
||||
RenditionsService,
|
||||
SettingsService,
|
||||
StorageService,
|
||||
LogService
|
||||
RenditionsService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -20,15 +20,10 @@ import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { searchMockApi, mockError, fakeSearch } from '../mock/search.service.mock';
|
||||
import { CookieServiceMock } from './../mock/cookie.service.mock';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { SettingsService } from './settings.service';
|
||||
import { AppConfigModule } from '../app-config/app-config.module';
|
||||
import { AuthenticationService } from './authentication.service';
|
||||
import { CookieService } from './cookie.service';
|
||||
import { LogService } from './log.service';
|
||||
import { SearchService } from './search.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { TranslateLoaderService } from './translate-loader.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
|
||||
describe('SearchService', () => {
|
||||
|
||||
@@ -48,14 +43,7 @@ describe('SearchService', () => {
|
||||
],
|
||||
providers: [
|
||||
SearchService,
|
||||
AuthenticationService,
|
||||
AlfrescoApiService,
|
||||
SettingsService,
|
||||
AuthenticationService,
|
||||
StorageService,
|
||||
UserPreferencesService,
|
||||
{ provide: CookieService, useClass: CookieServiceMock },
|
||||
LogService
|
||||
{ provide: CookieService, useClass: CookieServiceMock }
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -17,13 +17,9 @@
|
||||
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { SettingsService } from './settings.service';
|
||||
import { AppConfigModule } from '../app-config/app-config.module';
|
||||
import { LogService } from './log.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { TranslateLoaderService } from './translate-loader.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
|
||||
describe('SettingsService', () => {
|
||||
|
||||
@@ -41,11 +37,7 @@ describe('SettingsService', () => {
|
||||
})
|
||||
],
|
||||
providers: [
|
||||
AlfrescoApiService,
|
||||
SettingsService,
|
||||
UserPreferencesService,
|
||||
StorageService,
|
||||
LogService
|
||||
SettingsService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -17,16 +17,10 @@
|
||||
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { SettingsService } from './settings.service';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { AppConfigModule } from '../app-config/app-config.module';
|
||||
import { AuthenticationService } from './authentication.service';
|
||||
import { LogService } from './log.service';
|
||||
import { SitesService } from './sites.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { TranslateLoaderService } from './translate-loader.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -46,13 +40,7 @@ describe('Sites service', () => {
|
||||
})
|
||||
],
|
||||
providers: [
|
||||
SitesService,
|
||||
AlfrescoApiService,
|
||||
UserPreferencesService,
|
||||
AuthenticationService,
|
||||
SettingsService,
|
||||
StorageService,
|
||||
LogService
|
||||
SitesService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -15,8 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AppConfigService } from './app-config.service';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
|
||||
export function startupServiceFactory(configService: AppConfigService): Function {
|
||||
return () => configService.load();
|
||||
export function startupServiceFactory(alfrescoApiService: AlfrescoApiService): Function {
|
||||
return () => alfrescoApiService.load();
|
||||
}
|
@@ -21,17 +21,10 @@ import { MatIconRegistry } from '@angular/material';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { CookieServiceMock } from './../mock/cookie.service.mock';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { ContentService } from './content.service';
|
||||
import { SettingsService } from './settings.service';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { AuthenticationService } from './authentication.service';
|
||||
import { CookieService } from './cookie.service';
|
||||
import { LogService } from './log.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { ThumbnailService } from './thumbnail.service';
|
||||
import { TranslateLoaderService } from './translate-loader.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
|
||||
describe('ThumbnailService', () => {
|
||||
|
||||
@@ -50,17 +43,9 @@ describe('ThumbnailService', () => {
|
||||
})
|
||||
],
|
||||
providers: [
|
||||
UserPreferencesService,
|
||||
AuthenticationService,
|
||||
ContentService,
|
||||
SettingsService,
|
||||
AppConfigService,
|
||||
{ provide: CookieService, useClass: CookieServiceMock },
|
||||
ThumbnailService,
|
||||
AlfrescoApiService,
|
||||
SettingsService,
|
||||
StorageService,
|
||||
LogService,
|
||||
MatIconRegistry
|
||||
]
|
||||
}).compileComponents();
|
||||
|
@@ -19,14 +19,9 @@ import { HttpClientModule } from '@angular/common/http';
|
||||
import { Injector } from '@angular/core';
|
||||
import { getTestBed, TestBed } from '@angular/core/testing';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { LogService } from './log.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { TranslateLoaderService } from './translate-loader.service';
|
||||
import { TRANSLATION_PROVIDER, TranslationService } from './translation.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
|
||||
let componentJson1 = ' {"TEST": "This is a test", "TEST2": "This is another test"} ' ;
|
||||
|
||||
@@ -50,11 +45,6 @@ describe('TranslateLoader', () => {
|
||||
],
|
||||
providers: [
|
||||
TranslationService,
|
||||
LogService,
|
||||
AlfrescoApiService,
|
||||
StorageService,
|
||||
UserPreferencesService,
|
||||
AppConfigService,
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
|
@@ -20,13 +20,8 @@ import { Injector } from '@angular/core';
|
||||
import { getTestBed, TestBed } from '@angular/core/testing';
|
||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { LogService } from './log.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { TranslateLoaderService } from './translate-loader.service';
|
||||
import { TRANSLATION_PROVIDER, TranslationService } from './translation.service';
|
||||
import { UserPreferencesService } from './user-preferences.service';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -47,11 +42,6 @@ describe('TranslationService', () => {
|
||||
],
|
||||
providers: [
|
||||
TranslationService,
|
||||
LogService,
|
||||
AlfrescoApiService,
|
||||
StorageService,
|
||||
UserPreferencesService,
|
||||
AppConfigService,
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
|
@@ -18,13 +18,9 @@
|
||||
import { EventEmitter } from '@angular/core';
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { FileModel, FileUploadOptions, FileUploadStatus } from '../models/file.model';
|
||||
import { AlfrescoApiService } from './alfresco-api.service';
|
||||
import { SettingsService } from './settings.service';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
import { AppConfigModule } from '../app-config/app-config.module';
|
||||
import { AuthenticationService } from './authentication.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { UploadService } from './upload.service';
|
||||
import { AppConfigService } from '../app-config/app-config.service';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -37,11 +33,7 @@ describe('UploadService', () => {
|
||||
AppConfigModule
|
||||
],
|
||||
providers: [
|
||||
UploadService,
|
||||
AlfrescoApiService,
|
||||
SettingsService,
|
||||
AuthenticationService,
|
||||
StorageService
|
||||
UploadService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -10,6 +10,10 @@
|
||||
|
||||
.adf-toolbar {
|
||||
|
||||
&-title{
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.mat-toolbar {
|
||||
min-height: $adf-toolbar-height;
|
||||
border: 1px solid mat-color($foreground, text, .07);
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { AlfrescoApiService, LogService } from '../../services';
|
||||
import { BpmUserModel } from '../models/bpm-user.model';
|
||||
import { BpmUserService } from '../services/bpm-user.service';
|
||||
|
||||
@@ -29,7 +28,7 @@ describe('Bpm user service', () => {
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [
|
||||
AlfrescoApiService, LogService, BpmUserService
|
||||
BpmUserService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
@@ -17,10 +17,7 @@
|
||||
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
||||
import { AuthenticationService } from '../../services/authentication.service';
|
||||
import { ContentService } from '../../services/content.service';
|
||||
import { SettingsService } from '../../services/settings.service';
|
||||
import { MaterialModule } from '../../material.module';
|
||||
import { ToolbarModule } from '../../toolbar/toolbar.module';
|
||||
|
||||
@@ -44,12 +41,7 @@ describe('Test Img viewer component ', () => {
|
||||
MaterialModule,
|
||||
ToolbarModule
|
||||
],
|
||||
declarations: [ImgViewerComponent],
|
||||
providers: [
|
||||
SettingsService,
|
||||
AuthenticationService,
|
||||
AlfrescoApiService
|
||||
]
|
||||
declarations: [ImgViewerComponent]
|
||||
}).compileComponents();
|
||||
service = TestBed.get(ContentService);
|
||||
}));
|
||||
|
@@ -20,10 +20,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MediaPlayerComponent } from './mediaPlayer.component';
|
||||
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
AuthenticationService,
|
||||
ContentService,
|
||||
SettingsService
|
||||
ContentService
|
||||
} from '../../services';
|
||||
|
||||
describe('Test Media player component ', () => {
|
||||
@@ -39,13 +36,7 @@ describe('Test Media player component ', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
|
||||
declarations: [MediaPlayerComponent],
|
||||
providers: [
|
||||
SettingsService,
|
||||
AuthenticationService,
|
||||
AlfrescoApiService
|
||||
]
|
||||
declarations: [MediaPlayerComponent]
|
||||
}).compileComponents();
|
||||
service = TestBed.get(ContentService);
|
||||
}));
|
||||
|
@@ -17,11 +17,6 @@
|
||||
|
||||
import { Component, SimpleChange, ViewChild } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
AuthenticationService,
|
||||
SettingsService
|
||||
} from '../../services';
|
||||
import { MaterialModule } from '../../material.module';
|
||||
import { ToolbarModule } from '../../toolbar/toolbar.module';
|
||||
import { EventMock } from '../../mock/event.mock';
|
||||
@@ -152,9 +147,6 @@ describe('Test PdfViewer component', () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
SettingsService,
|
||||
AuthenticationService,
|
||||
AlfrescoApiService,
|
||||
RenderingQueueServices
|
||||
]
|
||||
})
|
||||
|
@@ -17,11 +17,6 @@
|
||||
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
AuthenticationService,
|
||||
SettingsService
|
||||
} from '../../services';
|
||||
import { TxtViewerComponent } from './txtViewer.component';
|
||||
|
||||
describe('Text View component', () => {
|
||||
@@ -32,12 +27,7 @@ describe('Text View component', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [TxtViewerComponent],
|
||||
providers: [
|
||||
SettingsService,
|
||||
AuthenticationService,
|
||||
AlfrescoApiService
|
||||
]
|
||||
declarations: [TxtViewerComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -167,7 +167,6 @@ describe('ViewerComponent', () => {
|
||||
return Observable.throw('throwed');
|
||||
}
|
||||
}},
|
||||
AlfrescoApiService,
|
||||
RenderingQueueServices,
|
||||
{ provide: Location, useClass: SpyLocation }
|
||||
]
|
||||
|
Reference in New Issue
Block a user