mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
* remove tag and rating service the testbed * remove unused import in modules * pdf viewer async * viewer test fixed * remove testbed share datatable * remove unused dependencies * add missing parameter * remove testbed from folder actions service * TaskHeaderComponent async * remove testbed from document actions and list * remove unused import * use done for nested test * fast finish false
82 lines
2.3 KiB
TypeScript
82 lines
2.3 KiB
TypeScript
/*!
|
|
* @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 { async, TestBed } from '@angular/core/testing';
|
|
import { AppConfigService } from '@alfresco/adf-core';
|
|
import { DiagramsService } from './diagrams.service';
|
|
|
|
declare let jasmine: any;
|
|
|
|
describe('DiagramsService', () => {
|
|
|
|
let service: DiagramsService;
|
|
|
|
beforeEach(async(() => {
|
|
TestBed.configureTestingModule({
|
|
providers: [
|
|
DiagramsService
|
|
]
|
|
}).compileComponents();
|
|
}));
|
|
|
|
beforeEach(() => {
|
|
let appConfig: AppConfigService = TestBed.get(AppConfigService);
|
|
appConfig.config.ecmHost = 'http://localhost:9876/ecm';
|
|
|
|
service = TestBed.get(DiagramsService);
|
|
});
|
|
|
|
beforeEach(() => {
|
|
jasmine.Ajax.install();
|
|
});
|
|
|
|
afterEach(() => {
|
|
jasmine.Ajax.uninstall();
|
|
});
|
|
|
|
it('getProcessDefinitionModel should perform a call against the server', (done) => {
|
|
service.getProcessDefinitionModel('fake-processDefinitionId').subscribe(() => {
|
|
done();
|
|
});
|
|
|
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
|
status: 200
|
|
});
|
|
});
|
|
|
|
it('getRunningProcessDefinitionModel should perform a call against the server', (done) => {
|
|
service.getRunningProcessDefinitionModel('fake-processInstanceId').subscribe(() => {
|
|
done();
|
|
});
|
|
|
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
|
status: 200
|
|
});
|
|
});
|
|
|
|
it('getTagsByNodeId catch errors call', (done) => {
|
|
service.getProcessDefinitionModel('fake-processDefinitionId').subscribe(() => {
|
|
}, () => {
|
|
done();
|
|
});
|
|
|
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
|
status: 403
|
|
});
|
|
});
|
|
});
|