[no-issue] speed up test CS part 2 (#3009)

* 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
This commit is contained in:
Eugenio Romano
2018-02-28 17:15:52 +00:00
committed by GitHub
parent b359579078
commit 45426fd246
52 changed files with 410 additions and 561 deletions

View File

@@ -15,8 +15,7 @@
* limitations under the License.
*/
import { async, TestBed } from '@angular/core/testing';
import { AppConfigService, CoreModule } from '@alfresco/adf-core';
import { AlfrescoApiService, LogService, AppConfigService, StorageService } from '@alfresco/adf-core';
import { TagService } from './tag.service';
declare let jasmine: any;
@@ -25,22 +24,8 @@ describe('TagService', () => {
let service: TagService;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
CoreModule
],
providers: [
TagService
]
}).compileComponents();
}));
beforeEach(() => {
let appConfig: AppConfigService = TestBed.get(AppConfigService);
appConfig.config.ecmHost = 'http://localhost:9876/ecm';
service = TestBed.get(TagService);
service = new TagService(new AlfrescoApiService(new AppConfigService(null), new StorageService()), new LogService(new AppConfigService(null)));
});
beforeEach(() => {
@@ -53,58 +38,6 @@ describe('TagService', () => {
describe('Content tests', () => {
it('removeTag should perform a call against the server', (done) => {
service.removeTag('fake-node-id', 'fake-tag').subscribe(() => {
expect(jasmine.Ajax.requests.mostRecent().method).toBe('DELETE');
expect(jasmine.Ajax.requests.mostRecent().url)
.toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/tags/fake-tag');
done();
});
jasmine.Ajax.requests.mostRecent().respondWith({
status: 200
});
});
it('addTag should perform a call against the server', (done) => {
service.addTag('fake-node-id', 'fake-tag').subscribe(() => {
expect(jasmine.Ajax.requests.mostRecent().method).toBe('POST');
expect(jasmine.Ajax.requests.mostRecent().url)
.toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/tags');
done();
});
jasmine.Ajax.requests.mostRecent().respondWith({
status: 200
});
});
it('getAllTheTags should perform a call against the server', (done) => {
service.getAllTheTags().subscribe(() => {
expect(jasmine.Ajax.requests.mostRecent().method).toBe('GET');
expect(jasmine.Ajax.requests.mostRecent().url)
.toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/tags');
done();
});
jasmine.Ajax.requests.mostRecent().respondWith({
status: 200
});
});
it('getTagsByNodeId should perform a call against the server', (done) => {
service.getTagsByNodeId('fake-node-id').subscribe(() => {
expect(jasmine.Ajax.requests.mostRecent().method).toBe('GET');
expect(jasmine.Ajax.requests.mostRecent().url)
.toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/tags');
done();
});
jasmine.Ajax.requests.mostRecent().respondWith({
status: 200
});
});
it('getTagsByNodeId catch errors call', (done) => {
service.getTagsByNodeId('fake-node-id').subscribe(() => {
}, () => {

View File

@@ -16,10 +16,9 @@
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AppConfigService, CoreModule } from '@alfresco/adf-core';
import { AppConfigService } from '@alfresco/adf-core';
import { TagActionsComponent } from './tag-actions.component';
import { TagService } from './services/tag.service';
import { MaterialModule } from '../material.module';
declare let jasmine: any;
@@ -31,10 +30,6 @@ describe('TagActionsComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
MaterialModule,
CoreModule
],
declarations: [
TagActionsComponent
],

View File

@@ -16,10 +16,9 @@
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AppConfigService, CoreModule } from '@alfresco/adf-core';
import { AppConfigService } from '@alfresco/adf-core';
import { TagService } from './services/tag.service';
import { TagListComponent } from '././tag-list.component';
import { MaterialModule } from '../material.module';
declare let jasmine: any;
@@ -48,10 +47,6 @@ describe('TagList', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
MaterialModule,
CoreModule
],
declarations: [
TagListComponent
],

View File

@@ -16,10 +16,9 @@
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AppConfigService, CoreModule } from '@alfresco/adf-core';
import { AppConfigService } from '@alfresco/adf-core';
import { TagNodeListComponent } from './tag-node-list.component';
import { TagService } from './services/tag.service';
import { MaterialModule } from '../material.module';
declare let jasmine: any;
@@ -48,10 +47,7 @@ describe('TagNodeList', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
MaterialModule,
CoreModule
],
declarations: [
TagNodeListComponent
],