mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
fix webscript tests
This commit is contained in:
@@ -1,36 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @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 { Injectable } from '@angular/core';
|
|
||||||
|
|
||||||
@Injectable()
|
|
||||||
export class AlfrescoSettingsServiceMock {
|
|
||||||
|
|
||||||
static DEFAULT_HOST_ADDRESS: string = 'fakehost';
|
|
||||||
|
|
||||||
private providers: string[] = ['ECM', 'BPM'];
|
|
||||||
|
|
||||||
private _host: string = AlfrescoSettingsServiceMock.DEFAULT_HOST_ADDRESS;
|
|
||||||
|
|
||||||
public get ecmHost(): string {
|
|
||||||
return this._host;
|
|
||||||
}
|
|
||||||
|
|
||||||
getProviders(): string [] {
|
|
||||||
return this.providers;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -18,7 +18,6 @@
|
|||||||
import { describe, expect, it, inject, beforeEachProviders, beforeEach, afterEach, xit } from '@angular/core/testing';
|
import { describe, expect, it, inject, beforeEachProviders, beforeEach, afterEach, xit } from '@angular/core/testing';
|
||||||
import { TestComponentBuilder } from '@angular/compiler/testing';
|
import { TestComponentBuilder } from '@angular/compiler/testing';
|
||||||
import { WebscriptComponent } from '../src/webscript.component';
|
import { WebscriptComponent } from '../src/webscript.component';
|
||||||
import { AlfrescoSettingsServiceMock } from '../src/assets/AlfrescoSettingsService.service.mock';
|
|
||||||
|
|
||||||
import { AlfrescoAuthenticationService, AlfrescoSettingsService } from 'ng2-alfresco-core';
|
import { AlfrescoAuthenticationService, AlfrescoSettingsService } from 'ng2-alfresco-core';
|
||||||
|
|
||||||
@@ -30,7 +29,7 @@ describe('Test ng2-alfresco-webscript', () => {
|
|||||||
|
|
||||||
beforeEachProviders(() => {
|
beforeEachProviders(() => {
|
||||||
return [
|
return [
|
||||||
{provide: AlfrescoSettingsService, useClass: AlfrescoSettingsServiceMock},
|
AlfrescoSettingsService,
|
||||||
AlfrescoAuthenticationService
|
AlfrescoAuthenticationService
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
@@ -86,7 +85,7 @@ describe('Test ng2-alfresco-webscript', () => {
|
|||||||
component.ngOnChanges().then(() => {
|
component.ngOnChanges().then(() => {
|
||||||
webscriptComponentFixture.detectChanges();
|
webscriptComponentFixture.detectChanges();
|
||||||
let request = jasmine.Ajax.requests.mostRecent();
|
let request = jasmine.Ajax.requests.mostRecent();
|
||||||
expect(request.url).toBe('fakehost/alfresco/service/sample/folder/Company%20Home');
|
expect(request.url).toBe('http://localhost:8080/alfresco/service/sample/folder/Company%20Home');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user