[ADF-3191] Fix userprefrence oauth2 (#3488)

* remove user preference setting save

* fix host setting test

* remove userPreferences test

* fix title service test

* remove unused imports

* restore input align

* fix service import in test tag rating
This commit is contained in:
Eugenio Romano
2018-06-15 08:32:16 +01:00
committed by GitHub
parent af2cde0791
commit 8966e22487
43 changed files with 417 additions and 528 deletions

View File

@@ -15,15 +15,8 @@
* limitations under the License.
*/
import {
AlfrescoApiServiceMock,
AppConfigService,
ContentService,
StorageService,
UserPreferencesService,
setupTestBed,
CoreModule,
TranslationMock
import { AlfrescoApiServiceMock, AppConfigService, ContentService,
StorageService, setupTestBed, CoreModule, TranslationMock
} from '@alfresco/adf-core';
import { FileNode, FolderNode } from '../../mock';
import { ContentActionHandler } from '../models/content-action.model';
@@ -31,14 +24,12 @@ import { DocumentActionsService } from './document-actions.service';
import { DocumentListService } from './document-list.service';
import { NodeActionsService } from './node-actions.service';
import { Observable } from 'rxjs/Observable';
import { TestBed } from '@angular/core/testing';
describe('DocumentActionsService', () => {
let service: DocumentActionsService;
let documentListService: DocumentListService;
let nodeActionsService: NodeActionsService;
let userPreferences;
setupTestBed({
imports: [
@@ -47,9 +38,8 @@ describe('DocumentActionsService', () => {
});
beforeEach(() => {
userPreferences = TestBed.get(UserPreferencesService);
let contentService = new ContentService(null, null, null, null);
let alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), userPreferences, new StorageService());
let alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
documentListService = new DocumentListService(null, contentService, alfrescoApiService, null, null);
service = new DocumentActionsService(null, null, new TranslationMock(), documentListService, contentService);

View File

@@ -16,9 +16,8 @@
*/
import { AlfrescoApiServiceMock, AlfrescoApiService,
AppConfigService, StorageService, ContentService, UserPreferencesService, setupTestBed, CoreModule } from '@alfresco/adf-core';
AppConfigService, StorageService, ContentService, setupTestBed, CoreModule } from '@alfresco/adf-core';
import { DocumentListService } from './document-list.service';
import { TestBed } from '@angular/core/testing';
declare let jasmine: any;
@@ -26,7 +25,6 @@ describe('DocumentListService', () => {
let service: DocumentListService;
let alfrescoApiService: AlfrescoApiService;
let userPreferences: UserPreferencesService;
let fakeEntryNode = {
'entry': {
@@ -96,10 +94,8 @@ describe('DocumentListService', () => {
});
beforeEach(() => {
userPreferences = TestBed.get(UserPreferencesService);
let contentService = new ContentService(null, null, null, null);
alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), userPreferences, new StorageService());
alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
service = new DocumentListService(null, contentService, alfrescoApiService, null, null);
jasmine.Ajax.install();
});

View File

@@ -16,7 +16,7 @@
*/
import { TestBed } from '@angular/core/testing';
import { AlfrescoApiServiceMock, AppConfigService, StorageService, ContentService, setupTestBed, CoreModule, TranslationMock, UserPreferencesService } from '@alfresco/adf-core';
import { AlfrescoApiServiceMock, AppConfigService, StorageService, ContentService, setupTestBed, CoreModule, TranslationMock } from '@alfresco/adf-core';
import { Observable } from 'rxjs/Observable';
import { FileNode, FolderNode } from '../../mock';
import { ContentActionHandler } from '../models/content-action.model';
@@ -27,7 +27,6 @@ describe('FolderActionsService', () => {
let service: FolderActionsService;
let documentListService: DocumentListService;
let userPreferences: UserPreferencesService;
setupTestBed({
imports: [
@@ -39,10 +38,8 @@ describe('FolderActionsService', () => {
let appConfig: AppConfigService = TestBed.get(AppConfigService);
appConfig.config.ecmHost = 'http://localhost:9876/ecm';
userPreferences = TestBed.get(UserPreferencesService);
let contentService = new ContentService(null, null, null, null);
let alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), userPreferences, new StorageService());
let alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
documentListService = new DocumentListService(null, contentService, alfrescoApiService, null, null);
service = new FolderActionsService(null, documentListService, contentService, new TranslationMock());
});

View File

@@ -15,27 +15,23 @@
* limitations under the License.
*/
import { AlfrescoApiServiceMock, AppConfigService, StorageService, setupTestBed, CoreModule, UserPreferencesService } from '@alfresco/adf-core';
import { RatingService } from './rating.service';
import { TestBed } from '@angular/core/testing';
import { setupTestBed } from '@alfresco/adf-core';
import { RatingService } from './rating.service';
import { ContentTestingModule } from '../../testing/content.testing.module';
declare let jasmine: any;
describe('Rating service', () => {
let service;
let userPreferences: UserPreferencesService;
setupTestBed({
imports: [
CoreModule.forRoot()
]
imports: [ContentTestingModule]
});
beforeEach(() => {
userPreferences = TestBed.get(UserPreferencesService);
service = new RatingService(new AlfrescoApiServiceMock(new AppConfigService(null), userPreferences, new StorageService()));
service = TestBed.get(RatingService);
});
beforeEach(() => {

View File

@@ -15,26 +15,23 @@
* limitations under the License.
*/
import { AlfrescoApiServiceMock, LogService, AppConfigService, StorageService, setupTestBed, CoreModule, UserPreferencesService } from '@alfresco/adf-core';
import { setupTestBed } from '@alfresco/adf-core';
import { TagService } from './tag.service';
import { TestBed } from '@angular/core/testing';
import { ContentTestingModule } from '../../testing/content.testing.module';
declare let jasmine: any;
describe('TagService', () => {
let service: TagService;
let userPreferences: UserPreferencesService;
setupTestBed({
imports: [
CoreModule.forRoot()
]
imports: [ContentTestingModule]
});
beforeEach(() => {
userPreferences = TestBed.get(UserPreferencesService);
service = new TagService(new AlfrescoApiServiceMock(new AppConfigService(null), userPreferences, new StorageService()), new LogService(new AppConfigService(null)));
service = TestBed.get(TagService);
});
beforeEach(() => {