[ADF-2240] fix e2e and test in demo shell (#3035)

* fix e2e and test in demo shell

* test single run demo shell conf

* fix script e2e

* fix test lint problems

* remove async from nested test

* fix pdf test

* modify url load pdf strategy test

* SimpleChange import

* pdf viewer test fix

* remove force closing

* refactor pdf viewer
-remove promise approach
-add event rendered
-add destroy worker

* increment timeout

* use proxy files

* remove require

* fix viewer component test

* remove last require

* prefer use of done for txt viewer test
This commit is contained in:
Eugenio Romano
2018-03-09 12:16:05 +00:00
committed by GitHub
parent 606009cac2
commit ae489f6737
21 changed files with 566 additions and 503 deletions

View File

@@ -1,32 +1,25 @@
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AdfModule } from './adf.module';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
AdfModule
],
declarations: [
AppComponent
]
}).compileComponents();
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app works!'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app works!');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('app works!');
}));
it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
});

View File

@@ -60,6 +60,10 @@ import 'zone.js/dist/zone'; // Included with Angular CLI.
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
*/
import 'intl'; // Run `npm install --save intl`.
/**
* Need to import at least one locale-data with intl.
*/
import 'intl/locale-data/jsonp/en';
/**
* Support custom event in IE11

View File

@@ -2,19 +2,41 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"module": "commonjs",
"target": "es5",
"baseUrl": "",
"module": "es2015",
"rootDir": "..",
"baseUrl": ".",
"skipLibCheck": false,
"types": [
"jasmine",
"node"
]
],
"paths": {
"alfresco-js-api": [
"../node_modules/alfresco-js-api/dist/alfresco-js-api.js"
],
"rxjs/*": [
"../node_modules/rxjs/*"
],
"@angular/*": [
"../node_modules/@angular/*"
],
"@alfresco/adf-core": [
"../../lib/core"
],
"@alfresco/adf-content-services": [
"../../lib/content-services"
],
"@alfresco/adf-process-services": [
"../../lib/process-services"
],
"@alfresco/adf-insights": [
"../../lib/insights"
]
}
},
"files": [
"test.ts"
"exclude": [
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
"angularCompilerOptions": {
"skipTemplateCodegen": false
}
}