Add code for data format webtool
[dcaegen2/platform/cli.git] / dcaedftool / src / app / app.component.spec.ts
1 // org.onap.dcae
2 // ============LICENSE_START====================================================
3 // Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
4 // =============================================================================
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 // ============LICENSE_END======================================================
17 //
18 // ECOMP is a trademark and service mark of AT&T Intellectual Property.
19 import { NgModule } from '@angular/core';
20 import { BrowserModule } from '@angular/platform-browser';
21 import {HttpModule} from '@angular/http';  // for future
22 import {FormsModule, ReactiveFormsModule} from '@angular/forms'; // for future
23 import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; // for future
24 import { MaterialModule } from '@angular/material';
25 import { FlexLayoutModule } from '@angular/flex-layout';
26 import { RouterModule, Routes } from '@angular/router';
27 import { APP_BASE_HREF } from '@angular/common';
28
29
30
31 import { AppComponent } from './app.component';
32 import { DFSchemaComponent } from './df-schema.component';
33 import { DFJSONInputComponent } from './df-jsoninput.component';
34 import { DFControlComponent } from './df-control.component';
35 import {ValidateMetaSchemaService} from './validate-metaschema.service';
36 import {ValidateJSONService} from './validate-json.service';
37 import {MetaSchemaService} from './metaschema.service';
38
39 const dfroutes: Routes = [
40   { path: '', redirectTo: 'schemaval', pathMatch: 'full' },
41   { path: 'schemaval',  component: DFSchemaComponent },
42   { path: 'jsoninput',  component: DFJSONInputComponent },
43
44 ];
45
46 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
47 import { By } from '@angular/platform-browser';
48 import { DebugElement } from '@angular/core';
49
50 describe('AppComponent', function () {
51   let de: DebugElement;
52   let comp: AppComponent;
53   let fixture: ComponentFixture<AppComponent>;
54
55   beforeEach(async(() => {
56     TestBed.configureTestingModule({
57       imports:      [  BrowserModule,
58         BrowserAnimationsModule,
59         FormsModule,
60         HttpModule,
61         ReactiveFormsModule,
62         FlexLayoutModule,
63         MaterialModule,
64         RouterModule.forRoot(dfroutes),
65         ],
66       providers: [{provide: APP_BASE_HREF, useValue: '/'}],
67       declarations: [ AppComponent,
68                       DFSchemaComponent,
69                       DFJSONInputComponent,
70                       DFControlComponent,
71
72                    ]
73     })
74     .compileComponents();
75   }));
76
77   beforeEach(() => {
78     fixture = TestBed.createComponent(AppComponent);
79     comp = fixture.componentInstance;
80     //de = fixture.debugElement.query(By.css('h1'));
81   });
82
83   it('should create component', () => expect(comp).toBeDefined() );
84
85 /*  it('should have expected <h1> text', () => {
86     fixture.detectChanges();
87     const h1 = de.nativeElement;
88       expect(h1.innerText).toMatch(/angular/i,
89       '<h1> should say something about "Angular"');
90   }); */
91 });