mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4457] StorageService should be independent of AppConfigService (#4712)
* [ADF-4457] StorageService should be independent of AppConfigService * [ADF-4457] Fix e2e tests * [ADF-4457] Fix e2e tests * [ADF-4457] Improve storage service workflow * Fix linting * Fix unit tests * Fix e2e test * Add missing class to constructor * Fix e2e test * Rebase branch * Improve unit test * fix test
This commit is contained in:
committed by
Eugenio Romano
parent
90c403ae9e
commit
5c07d5b3e6
@@ -18,7 +18,7 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { FormCloudService } from './form-cloud.service';
|
||||
import { AlfrescoApiService, CoreModule, setupTestBed, AppConfigService, AppConfigServiceMock } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, CoreModule, setupTestBed, AppConfigService } from '@alfresco/adf-core';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
declare let jasmine: any;
|
||||
@@ -28,11 +28,6 @@ const responseBody = {
|
||||
{ id: 'id', name: 'name', formKey: 'form-key' }
|
||||
};
|
||||
|
||||
const alfrescoApiServiceStub = {
|
||||
getInstance() { },
|
||||
load() { }
|
||||
};
|
||||
|
||||
const oauth2Auth = jasmine.createSpyObj('oauth2Auth', ['callCustomApi']);
|
||||
|
||||
describe('Form Cloud service', () => {
|
||||
@@ -48,11 +43,7 @@ describe('Form Cloud service', () => {
|
||||
NoopAnimationsModule,
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
providers: [
|
||||
FormCloudService,
|
||||
{ provide: AlfrescoApiService, useValue: alfrescoApiServiceStub },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock }
|
||||
]
|
||||
providers: [FormCloudService, AlfrescoApiService, AppConfigService]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { async } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { setupTestBed, StorageService } from '@alfresco/adf-core';
|
||||
import { fakeProcessCloudList } from '../mock/process-list-service.mock';
|
||||
import { AlfrescoApiServiceMock, LogService, AppConfigService, CoreModule } from '@alfresco/adf-core';
|
||||
import { ProcessListCloudService } from './process-list-cloud.service';
|
||||
@@ -62,7 +62,7 @@ describe('Activiti ProcessList Cloud Service', () => {
|
||||
});
|
||||
|
||||
beforeEach(async(() => {
|
||||
alfrescoApiMock = new AlfrescoApiServiceMock(new AppConfigService(null));
|
||||
alfrescoApiMock = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
|
||||
service = new ProcessListCloudService(alfrescoApiMock,
|
||||
new AppConfigService(null),
|
||||
new LogService(new AppConfigService(null)));
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { setupTestBed, IdentityUserService } from '@alfresco/adf-core';
|
||||
import { setupTestBed, IdentityUserService, StorageService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiServiceMock, LogService, AppConfigService, CoreModule } from '@alfresco/adf-core';
|
||||
import { TaskCloudService } from './task-cloud.service';
|
||||
import { taskCompleteCloudMock } from '../task-header/mocks/fake-complete-task.mock';
|
||||
@@ -68,7 +68,7 @@ describe('Task Cloud Service', () => {
|
||||
});
|
||||
|
||||
beforeEach(async(() => {
|
||||
alfrescoApiMock = new AlfrescoApiServiceMock(new AppConfigService(null));
|
||||
alfrescoApiMock = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
|
||||
identityUserService = TestBed.get(IdentityUserService);
|
||||
spyOn(identityUserService, 'getCurrentUserInfo').and.returnValue(cloudMockUser);
|
||||
service = new TaskCloudService(alfrescoApiMock,
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { async } from '@angular/core/testing';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
import { setupTestBed, StorageService } from '@alfresco/adf-core';
|
||||
import { fakeTaskCloudList } from '../mock/fakeTaskResponseMock';
|
||||
import { AlfrescoApiServiceMock, LogService, AppConfigService, CoreModule } from '@alfresco/adf-core';
|
||||
import { TaskListCloudService } from './task-list-cloud.service';
|
||||
@@ -64,7 +64,7 @@ describe('Activiti TaskList Cloud Service', () => {
|
||||
});
|
||||
|
||||
beforeEach(async(() => {
|
||||
alfrescoApiMock = new AlfrescoApiServiceMock(new AppConfigService(null));
|
||||
alfrescoApiMock = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService());
|
||||
service = new TaskListCloudService(alfrescoApiMock,
|
||||
new AppConfigService(null),
|
||||
new LogService(new AppConfigService(null)));
|
||||
|
Reference in New Issue
Block a user