#1387 fix img for systemjs and refactoring apiservice (#1421)

This commit is contained in:
Mario Romano
2017-01-10 16:59:08 +00:00
committed by Denys Vuika
parent c5dca890b7
commit 9fb085eb3a
18 changed files with 222 additions and 134 deletions

View File

@@ -18,6 +18,8 @@
import { ReflectiveInjector } from '@angular/core';
import { AlfrescoApiService } from './alfresco-api.service';
import { RenditionsService } from './renditions.service';
import { SettingsService } from './settings.service';
import { StorageService } from './storage.service';
import { LogService } from './log.service';
import { fakeRedition, fakeReditionCreated, fakeReditionsList } from '../assets/renditionsService.mock';
@@ -31,6 +33,8 @@ describe('RenditionsService', () => {
injector = ReflectiveInjector.resolveAndCreate([
AlfrescoApiService,
RenditionsService,
SettingsService,
StorageService,
LogService
]);
});
@@ -38,7 +42,6 @@ describe('RenditionsService', () => {
beforeEach(() => {
jasmine.Ajax.install();
service = injector.get(RenditionsService);
service.apiService.setInstance(new AlfrescoApi({}));
});
afterEach(() => {
@@ -60,7 +63,7 @@ describe('RenditionsService', () => {
it('Create redition service should call the server with the ID passed and the asked encoding', (done) => {
service.createRendition('fake-node-id', 'pdf').subscribe((res) => {
expect(jasmine.Ajax.requests.mostRecent().url).toBe('http://127.0.0.1:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/renditions');
expect(jasmine.Ajax.requests.mostRecent().url).toBe('http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/renditions');
done();
});