// fileChange method
it('Should validatte fileChange method if file type is xml', async(() => {
+ fixture = TestBed.createComponent(GoldenConfigurationComponent);
+ component = fixture.componentInstance;
let reader = new FileReader();
let file = new File(["testing"], "foo.xml", { type: "text/xml" });
let input = { files: [file] };
}));
it('Should validatte fileChange method if file type is json', async(() => {
+ fixture = TestBed.createComponent(GoldenConfigurationComponent);
+ component = fixture.componentInstance;
let reader = new FileReader();
let file = new File(["testing"], "foo.json", { type: "text/json" });
let input = { files: [file] };
}));
it('Should validatte fileChange method if file type is none ', async(() => {
+ fixture = TestBed.createComponent(GoldenConfigurationComponent);
+ component = fixture.componentInstance;
let reader = new FileReader();
let file = new File(["testing"], "foo", { type: "" });
let input = { files: [file] };
}));
it('Should validate if files is false', () => {
+ fixture = TestBed.createComponent(GoldenConfigurationComponent);
+ component = fixture.componentInstance;
let spy = spyOn(NotificationsService.prototype, 'error');
let reader = new FileReader();
let input = { files: [] };
});
it('Should validate if refObj is undefined', () => {
+ fixture = TestBed.createComponent(GoldenConfigurationComponent);
+ component = fixture.componentInstance;
let spy = spyOn(NotificationsService.prototype, 'error');
let reader = new FileReader();
let input = { files: [] };