fix test angular2 Final release viewer component #749

This commit is contained in:
Eugenio Romano
2016-10-04 18:14:16 +01:00
parent 89401ea2e5
commit f8ae57acec
18 changed files with 279 additions and 237 deletions

View File

@@ -15,24 +15,46 @@
* limitations under the License.
*/
/*
import { TestComponentBuilder } from '@angular/compiler/testing';
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { MediaPlayerComponent } from './mediaPlayer.component';
import { DebugElement } from '@angular/core';
import {
AlfrescoAuthenticationService,
AlfrescoSettingsService,
AlfrescoApiService,
CoreModule
} from 'ng2-alfresco-core';
describe('Media player component ', () => {
describe('Test ng2-alfresco-viewer Media player component ', () => {
let mediaPlayerComponentFixture, element, component;
let component: any;
let fixture: ComponentFixture<MediaPlayerComponent>;
let debug: DebugElement;
let element: HTMLElement;
beforeEach(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
return tcb
.createAsync(MediaPlayerComponent)
.then(fixture => {
mediaPlayerComponentFixture = fixture;
element = fixture.nativeElement;
component = fixture.componentInstance;
});
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
CoreModule
],
declarations: [MediaPlayerComponent],
providers: [
AlfrescoSettingsService,
AlfrescoAuthenticationService,
AlfrescoApiService
]
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MediaPlayerComponent);
debug = fixture.debugElement;
element = fixture.nativeElement;
component = fixture.componentInstance;
fixture.detectChanges();
});
it('If no url is passed should thrown an error', () => {
expect(() => {
component.ngOnChanges();
@@ -53,4 +75,3 @@ describe('Media player component ', () => {
}).not.toThrow(new Error('Attribute urlFile is required'));
});
});
*/