aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2018-08-13 15:08:36 +0530
committerTakamune Cho <tc012c@att.com>2018-08-13 23:52:43 +0000
commit4a95047a23c2a361f9d18675c2f77e01e65faa1c (patch)
tree6ee5861f7cab19a0647c518c4b0f8845855b661e
parente196dc483c18126715e00b6345de678d0fbf73ca (diff)
template-configuartion spec- fixed test cases
5 of the test cases in template-configuration spec file failed as these tets cases were trying to access the component instance which was only declared but not defined. Fixed this issue. Issue-ID: APPC-1064 Change-Id: Iadbc3b7b66ed30089400e35cf5632a72f5a34991 Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
-rw-r--r--src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.spec.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.spec.ts b/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.spec.ts
index 06cea21..bba9673 100644
--- a/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.spec.ts
+++ b/src/app/vnfs/build-artifacts/template-holder/template-configuration/template-configuration.component.spec.ts
@@ -378,6 +378,8 @@ describe('GoldenConfigurationComponent', () => {
// 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] };
@@ -393,6 +395,8 @@ describe('GoldenConfigurationComponent', () => {
}));
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] };
@@ -408,6 +412,8 @@ describe('GoldenConfigurationComponent', () => {
}));
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] };
@@ -424,6 +430,8 @@ describe('GoldenConfigurationComponent', () => {
}));
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: [] };
@@ -435,6 +443,8 @@ describe('GoldenConfigurationComponent', () => {
});
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: [] };