mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-967] evaluate "hostname" and "port" for string settings (#2040)
* evaluate 'hostname' and 'port' in app config strings * update unit tests * fix unit tests * fix unit tests * update readme
This commit is contained in:
committed by
Eugenio Romano
parent
c3561510b9
commit
26fe9ed694
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"ecmHost": "http://localhost:3000/ecm",
|
"ecmHost": "http://{hostname}:{port}/ecm",
|
||||||
"bpmHost": "http://localhost:3000/bpm",
|
"bpmHost": "http://{hostname}:{port}/bpm",
|
||||||
"application": {
|
"application": {
|
||||||
"name": "Alfresco"
|
"name": "Alfresco"
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"ecmHost": "http://localhost:3000/ecm",
|
"ecmHost": "http://{hostname}",
|
||||||
"bpmHost": "http://localhost:3000/bpm",
|
"bpmHost": "http://{hostname}",
|
||||||
"application": {
|
"application": {
|
||||||
"name": "Alfresco"
|
"name": "Alfresco"
|
||||||
}
|
}
|
||||||
|
@@ -90,7 +90,7 @@ describe('AnalyticsReportListComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return the default reports when the report list is empty', (done) => {
|
it('should return the default reports when the report list is empty', (done) => {
|
||||||
jasmine.Ajax.stubRequest('http://localhost:3000/bpm/activiti-app/app/rest/reporting/reports').andReturn({
|
jasmine.Ajax.stubRequest('http://localhost:9876/bpm/activiti-app/app/rest/reporting/reports').andReturn({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: 'json',
|
contentType: 'json',
|
||||||
responseText: []
|
responseText: []
|
||||||
@@ -98,13 +98,13 @@ describe('AnalyticsReportListComponent', () => {
|
|||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
jasmine.Ajax.stubRequest('http://localhost:3000/bpm/activiti-app/app/rest/reporting/default-reports').andReturn({
|
jasmine.Ajax.stubRequest('http://localhost:9876/bpm/activiti-app/app/rest/reporting/default-reports').andReturn({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: 'json',
|
contentType: 'json',
|
||||||
responseText: []
|
responseText: []
|
||||||
});
|
});
|
||||||
|
|
||||||
jasmine.Ajax.stubRequest('http://localhost:3000/bpm/activiti-app/app/rest/reporting/reports').andReturn({
|
jasmine.Ajax.stubRequest('http://localhost:9876/bpm/activiti-app/app/rest/reporting/reports').andReturn({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: 'json',
|
contentType: 'json',
|
||||||
responseText: reportList
|
responseText: reportList
|
||||||
|
@@ -295,13 +295,13 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
jasmine.Ajax.stubRequest('http://localhost:3000/bpm/activiti-app/app/rest/reporting/report-params/1').andReturn({
|
jasmine.Ajax.stubRequest('http://localhost:9876/bpm/activiti-app/app/rest/reporting/report-params/1').andReturn({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: 'json',
|
contentType: 'json',
|
||||||
responseText: analyticParamsMock.reportDefParamProcessDef
|
responseText: analyticParamsMock.reportDefParamProcessDef
|
||||||
});
|
});
|
||||||
|
|
||||||
jasmine.Ajax.stubRequest('http://localhost:3000/bpm/activiti-app/app/rest/reporting/process-definitions').andReturn({
|
jasmine.Ajax.stubRequest('http://localhost:9876/bpm/activiti-app/app/rest/reporting/process-definitions').andReturn({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: 'json',
|
contentType: 'json',
|
||||||
responseText: analyticParamsMock.reportDefParamProcessDefOptionsNoApp
|
responseText: analyticParamsMock.reportDefParamProcessDefOptionsNoApp
|
||||||
@@ -326,7 +326,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
jasmine.Ajax.stubRequest('http://localhost:3000/bpm/activiti-app/app/rest/reporting/report-params/1').andReturn({
|
jasmine.Ajax.stubRequest('http://localhost:9876/bpm/activiti-app/app/rest/reporting/report-params/1').andReturn({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: 'json',
|
contentType: 'json',
|
||||||
responseText: analyticParamsMock.reportDefParamProcessDef
|
responseText: analyticParamsMock.reportDefParamProcessDef
|
||||||
@@ -334,7 +334,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
|
|
||||||
let appId = '1';
|
let appId = '1';
|
||||||
|
|
||||||
jasmine.Ajax.stubRequest('http://localhost:3000/bpm/activiti-app/api/enterprise/process-definitions?appDefinitionId=' + appId).andReturn({
|
jasmine.Ajax.stubRequest('http://localhost:9876/bpm/activiti-app/api/enterprise/process-definitions?appDefinitionId=' + appId).andReturn({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: 'json',
|
contentType: 'json',
|
||||||
responseText: analyticParamsMock.reportDefParamProcessDefOptionsApp
|
responseText: analyticParamsMock.reportDefParamProcessDefOptionsApp
|
||||||
@@ -392,13 +392,13 @@ describe('AnalyticsReportParametersComponent', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
jasmine.Ajax.stubRequest('http://localhost:3000/bpm/activiti-app/app/rest/reporting/report-params/1').andReturn({
|
jasmine.Ajax.stubRequest('http://localhost:9876/bpm/activiti-app/app/rest/reporting/report-params/1').andReturn({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: 'json',
|
contentType: 'json',
|
||||||
responseText: analyticParamsMock.reportDefParamProcessDef
|
responseText: analyticParamsMock.reportDefParamProcessDef
|
||||||
});
|
});
|
||||||
|
|
||||||
jasmine.Ajax.stubRequest('http://localhost:3000/bpm/activiti-app/app/rest/reporting/process-definitions').andReturn({
|
jasmine.Ajax.stubRequest('http://localhost:9876/bpm/activiti-app/app/rest/reporting/process-definitions').andReturn({
|
||||||
status: 404,
|
status: 404,
|
||||||
contentType: 'json',
|
contentType: 'json',
|
||||||
responseText: []
|
responseText: []
|
||||||
|
@@ -526,7 +526,7 @@ describe('Form service', () => {
|
|||||||
|
|
||||||
function stubCreateForm() {
|
function stubCreateForm() {
|
||||||
jasmine.Ajax.stubRequest(
|
jasmine.Ajax.stubRequest(
|
||||||
'http://localhost:3000/bpm/activiti-app/api/enterprise/models'
|
'http://localhost:9876/bpm/activiti-app/api/enterprise/models'
|
||||||
).andReturn({
|
).andReturn({
|
||||||
status: 200,
|
status: 200,
|
||||||
statusText: 'HTTP/1.1 200 OK',
|
statusText: 'HTTP/1.1 200 OK',
|
||||||
@@ -537,7 +537,7 @@ describe('Form service', () => {
|
|||||||
|
|
||||||
function stubGetEcmModel() {
|
function stubGetEcmModel() {
|
||||||
jasmine.Ajax.stubRequest(
|
jasmine.Ajax.stubRequest(
|
||||||
'http://localhost:3000/ecm/alfresco/api/-default-/private/alfresco/versions/1/cmm/activitiFormsModel/types'
|
'http://localhost:9876/ecm/alfresco/api/-default-/private/alfresco/versions/1/cmm/activitiFormsModel/types'
|
||||||
).andReturn({
|
).andReturn({
|
||||||
status: 200,
|
status: 200,
|
||||||
statusText: 'HTTP/1.1 200 OK',
|
statusText: 'HTTP/1.1 200 OK',
|
||||||
@@ -558,7 +558,7 @@ describe('Form service', () => {
|
|||||||
|
|
||||||
function stubAddFieldsToAForm() {
|
function stubAddFieldsToAForm() {
|
||||||
jasmine.Ajax.stubRequest(
|
jasmine.Ajax.stubRequest(
|
||||||
'http://localhost:3000/bpm/activiti-app/api/enterprise/editor/form-models/' + formId
|
'http://localhost:9876/bpm/activiti-app/api/enterprise/editor/form-models/' + formId
|
||||||
).andReturn({
|
).andReturn({
|
||||||
status: 200,
|
status: 200,
|
||||||
statusText: 'HTTP/1.1 200 OK',
|
statusText: 'HTTP/1.1 200 OK',
|
||||||
|
@@ -354,6 +354,27 @@ if (process.env.ENV === 'production') {
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Variable substitution in configuration strings
|
||||||
|
|
||||||
|
The `AppConfigService` also supports a limited set of variable substitutions to greatly simplify certain scenarios.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ecmHost": "http://{hostname}:{port}/ecm",
|
||||||
|
"bpmHost": "http://{hostname}:{port}/bpm",
|
||||||
|
"application": {
|
||||||
|
"name": "Alfresco"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The supported variables are:
|
||||||
|
|
||||||
|
| Variable name | Runtime value |
|
||||||
|
| --- | --- |
|
||||||
|
| hostname | `location.hostname` |
|
||||||
|
| port | `location.port` |
|
||||||
|
|
||||||
## Notification Service
|
## Notification Service
|
||||||
|
|
||||||
The Notification Service is implemented on top of the Angular 2 Material Design snackbar.
|
The Notification Service is implemented on top of the Angular 2 Material Design snackbar.
|
||||||
|
@@ -83,7 +83,7 @@ describe('AlfrescoContentService', () => {
|
|||||||
|
|
||||||
it('should return a valid content URL', (done) => {
|
it('should return a valid content URL', (done) => {
|
||||||
authService.login('fake-username', 'fake-password').subscribe(() => {
|
authService.login('fake-username', 'fake-password').subscribe(() => {
|
||||||
expect(contentService.getContentUrl(node)).toBe('http://localhost:3000/ecm/alfresco/api/' +
|
expect(contentService.getContentUrl(node)).toBe('http://localhost:9876/ecm/alfresco/api/' +
|
||||||
'-default-/public/alfresco/versions/1/nodes/fake-node-id/content?attachment=false&alf_ticket=fake-post-ticket');
|
'-default-/public/alfresco/versions/1/nodes/fake-node-id/content?attachment=false&alf_ticket=fake-post-ticket');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
@@ -98,7 +98,7 @@ describe('AlfrescoContentService', () => {
|
|||||||
it('should return a valid thumbnail URL', (done) => {
|
it('should return a valid thumbnail URL', (done) => {
|
||||||
authService.login('fake-username', 'fake-password').subscribe(() => {
|
authService.login('fake-username', 'fake-password').subscribe(() => {
|
||||||
expect(contentService.getDocumentThumbnailUrl(node))
|
expect(contentService.getDocumentThumbnailUrl(node))
|
||||||
.toBe('http://localhost:3000/ecm/alfresco/api/-default-/public/alfresco' +
|
.toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco' +
|
||||||
'/versions/1/nodes/fake-node-id/renditions/doclib/content?attachment=false&alf_ticket=fake-post-ticket');
|
'/versions/1/nodes/fake-node-id/renditions/doclib/content?attachment=false&alf_ticket=fake-post-ticket');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
@@ -23,8 +23,8 @@ import { ObjectUtils } from '../utils/object-utils';
|
|||||||
export class AppConfigService {
|
export class AppConfigService {
|
||||||
|
|
||||||
private config: any = {
|
private config: any = {
|
||||||
'ecmHost': 'http://localhost:3000/ecm',
|
'ecmHost': 'http://{hostname}:{port}/ecm',
|
||||||
'bpmHost': 'http://localhost:3000/bpm',
|
'bpmHost': 'http://{hostname}:{port}/bpm',
|
||||||
'application': {
|
'application': {
|
||||||
'name': 'Alfresco'
|
'name': 'Alfresco'
|
||||||
}
|
}
|
||||||
@@ -35,7 +35,14 @@ export class AppConfigService {
|
|||||||
constructor(private http: Http) {}
|
constructor(private http: Http) {}
|
||||||
|
|
||||||
get<T>(key: string): T {
|
get<T>(key: string): T {
|
||||||
return <T> ObjectUtils.getValue(this.config, key);
|
let result: any = ObjectUtils.getValue(this.config, key);
|
||||||
|
if (typeof result === 'string') {
|
||||||
|
const map = new Map<string, string>();
|
||||||
|
map.set('hostname', location.hostname);
|
||||||
|
map.set('port', location.port);
|
||||||
|
result = this.formatString(result, map);
|
||||||
|
}
|
||||||
|
return <T> result;
|
||||||
}
|
}
|
||||||
|
|
||||||
load(resource: string = 'app.config.json'): Promise<any> {
|
load(resource: string = 'app.config.json'): Promise<any> {
|
||||||
@@ -54,6 +61,17 @@ export class AppConfigService {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private formatString(str: string, map: Map<string, string>): string {
|
||||||
|
let result = str;
|
||||||
|
|
||||||
|
map.forEach((value, key) => {
|
||||||
|
const expr = new RegExp('{' + key + '}', 'gm');
|
||||||
|
result = result.replace(expr, value);
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function InitAppConfigServiceProvider(resource: string): any {
|
export function InitAppConfigServiceProvider(resource: string): any {
|
||||||
|
@@ -71,7 +71,7 @@ describe('RenditionsService', () => {
|
|||||||
it('Create redition service should call the server with the ID passed and the asked encoding', (done) => {
|
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) => {
|
service.createRendition('fake-node-id', 'pdf').subscribe((res) => {
|
||||||
expect(jasmine.Ajax.requests.mostRecent().method).toBe('POST');
|
expect(jasmine.Ajax.requests.mostRecent().method).toBe('POST');
|
||||||
expect(jasmine.Ajax.requests.mostRecent().url).toBe('http://localhost:3000/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/renditions');
|
expect(jasmine.Ajax.requests.mostRecent().url).toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/renditions');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ describe('RenditionsService', () => {
|
|||||||
service.convert('fake-node-id', 'pdf', 1000);
|
service.convert('fake-node-id', 'pdf', 1000);
|
||||||
|
|
||||||
expect(jasmine.Ajax.requests.mostRecent().method).toBe('POST');
|
expect(jasmine.Ajax.requests.mostRecent().method).toBe('POST');
|
||||||
expect(jasmine.Ajax.requests.mostRecent().url).toBe('http://localhost:3000/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/renditions');
|
expect(jasmine.Ajax.requests.mostRecent().url).toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/renditions');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -118,7 +118,7 @@ describe('Test ng2-alfresco-tag Tag actions list', () => {
|
|||||||
deleteButton.click();
|
deleteButton.click();
|
||||||
|
|
||||||
expect(jasmine.Ajax.requests.at(1).url)
|
expect(jasmine.Ajax.requests.at(1).url)
|
||||||
.toBe('http://localhost:3000/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/tags/0ee933fa-57fc-4587-8a77-b787e814f1d2');
|
.toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/tags/0ee933fa-57fc-4587-8a77-b787e814f1d2');
|
||||||
expect(jasmine.Ajax.requests.at(1).method).toBe('DELETE');
|
expect(jasmine.Ajax.requests.at(1).method).toBe('DELETE');
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
|
@@ -117,7 +117,7 @@ describe('Test ng2-alfresco-tag Tag relative node list', () => {
|
|||||||
deleteButton.click();
|
deleteButton.click();
|
||||||
|
|
||||||
expect(jasmine.Ajax.requests.mostRecent().url).
|
expect(jasmine.Ajax.requests.mostRecent().url).
|
||||||
toBe('http://localhost:3000/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/tags/0ee933fa-57fc-4587-8a77-b787e814f1d2');
|
toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/tags/0ee933fa-57fc-4587-8a77-b787e814f1d2');
|
||||||
expect(jasmine.Ajax.requests.mostRecent().method).toBe('DELETE');
|
expect(jasmine.Ajax.requests.mostRecent().method).toBe('DELETE');
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
|
@@ -54,7 +54,7 @@ describe('Tag service', () => {
|
|||||||
service.removeTag('fake-node-id', 'fake-tag').subscribe(() => {
|
service.removeTag('fake-node-id', 'fake-tag').subscribe(() => {
|
||||||
expect(jasmine.Ajax.requests.mostRecent().method).toBe('DELETE');
|
expect(jasmine.Ajax.requests.mostRecent().method).toBe('DELETE');
|
||||||
expect(jasmine.Ajax.requests.mostRecent().url)
|
expect(jasmine.Ajax.requests.mostRecent().url)
|
||||||
.toBe('http://localhost:3000/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/tags/fake-tag');
|
.toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/tags/fake-tag');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ describe('Tag service', () => {
|
|||||||
service.addTag('fake-node-id', 'fake-tag').subscribe(() => {
|
service.addTag('fake-node-id', 'fake-tag').subscribe(() => {
|
||||||
expect(jasmine.Ajax.requests.mostRecent().method).toBe('POST');
|
expect(jasmine.Ajax.requests.mostRecent().method).toBe('POST');
|
||||||
expect(jasmine.Ajax.requests.mostRecent().url)
|
expect(jasmine.Ajax.requests.mostRecent().url)
|
||||||
.toBe('http://localhost:3000/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/tags');
|
.toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/tags');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ describe('Tag service', () => {
|
|||||||
service.getAllTheTags().subscribe(() => {
|
service.getAllTheTags().subscribe(() => {
|
||||||
expect(jasmine.Ajax.requests.mostRecent().method).toBe('GET');
|
expect(jasmine.Ajax.requests.mostRecent().method).toBe('GET');
|
||||||
expect(jasmine.Ajax.requests.mostRecent().url)
|
expect(jasmine.Ajax.requests.mostRecent().url)
|
||||||
.toBe('http://localhost:3000/ecm/alfresco/api/-default-/public/alfresco/versions/1/tags');
|
.toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/tags');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ describe('Tag service', () => {
|
|||||||
service.getTagsByNodeId('fake-node-id').subscribe(() => {
|
service.getTagsByNodeId('fake-node-id').subscribe(() => {
|
||||||
expect(jasmine.Ajax.requests.mostRecent().method).toBe('GET');
|
expect(jasmine.Ajax.requests.mostRecent().method).toBe('GET');
|
||||||
expect(jasmine.Ajax.requests.mostRecent().url)
|
expect(jasmine.Ajax.requests.mostRecent().url)
|
||||||
.toBe('http://localhost:3000/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/tags');
|
.toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/tags');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -85,7 +85,7 @@ describe('UploadService', () => {
|
|||||||
service.uploadFilesInTheQueue(emitter);
|
service.uploadFilesInTheQueue(emitter);
|
||||||
|
|
||||||
let request = jasmine.Ajax.requests.mostRecent();
|
let request = jasmine.Ajax.requests.mostRecent();
|
||||||
expect(request.url).toBe('http://localhost:3000/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?autoRename=true');
|
expect(request.url).toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?autoRename=true');
|
||||||
expect(request.method).toBe('POST');
|
expect(request.method).toBe('POST');
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
@@ -109,7 +109,7 @@ describe('UploadService', () => {
|
|||||||
service.addToQueue(fileFake);
|
service.addToQueue(fileFake);
|
||||||
service.uploadFilesInTheQueue(emitter);
|
service.uploadFilesInTheQueue(emitter);
|
||||||
expect(jasmine.Ajax.requests.mostRecent().url)
|
expect(jasmine.Ajax.requests.mostRecent().url)
|
||||||
.toBe('http://localhost:3000/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?autoRename=true');
|
.toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?autoRename=true');
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
'status': 404,
|
'status': 404,
|
||||||
@@ -159,7 +159,7 @@ describe('UploadService', () => {
|
|||||||
service.uploadFilesInTheQueue(emitter);
|
service.uploadFilesInTheQueue(emitter);
|
||||||
|
|
||||||
let request = jasmine.Ajax.requests.mostRecent();
|
let request = jasmine.Ajax.requests.mostRecent();
|
||||||
expect(request.url).toBe('http://localhost:3000/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/123/children?autoRename=true');
|
expect(request.url).toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/123/children?autoRename=true');
|
||||||
expect(request.method).toBe('POST');
|
expect(request.method).toBe('POST');
|
||||||
|
|
||||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||||
|
@@ -87,7 +87,7 @@ describe('Test ng2-alfresco-webscript', () => {
|
|||||||
|
|
||||||
component.ngOnChanges(null).then(() => {
|
component.ngOnChanges(null).then(() => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(jasmine.Ajax.requests.mostRecent().url).toBe('http://localhost:3000/ecm/alfresco/service/sample/folder/Company%20Home');
|
expect(jasmine.Ajax.requests.mostRecent().url).toBe('http://localhost:9876/ecm/alfresco/service/sample/folder/Company%20Home');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user