2 * # ============LICENSE_START=======================================================
3 * # Copyright (c) 2020 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
9 * # http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
19 import { HttpClientTestingModule } from '@angular/common/http/testing';
20 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
21 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
22 import { MatMenuModule, MatTooltipModule } from '@angular/material';
23 import { RouterTestingModule } from '@angular/router/testing';
24 import { JwtHelperService, JWT_OPTIONS } from '@auth0/angular-jwt';
25 import { Ng4LoadingSpinnerModule } from 'ng4-loading-spinner';
26 import { MessageService } from 'primeng/api';
27 import { ButtonModule } from 'primeng/button';
28 import { CalendarModule } from 'primeng/calendar';
29 import { DialogModule } from 'primeng/dialog';
30 import { DropdownModule } from 'primeng/dropdown';
31 import { ScrollPanelModule } from 'primeng/scrollpanel';
32 import { TableModule } from 'primeng/table';
33 import { ToastModule } from 'primeng/toast';
34 import { CompSpecAddComponent } from '../comp-spec-add/comp-spec-add.component';
35 import { MsInstanceAddComponent } from '../ms-instance-add/ms-instance-add.component';
37 import { MsInstancesComponent } from './msInstances.component';
39 describe('MsInstancesComponent', () => {
40 let component: MsInstancesComponent;
41 let fixture: ComponentFixture<MsInstancesComponent>;
43 beforeEach(async(() => {
44 TestBed.configureTestingModule({
48 MsInstanceAddComponent
51 Ng4LoadingSpinnerModule,
62 HttpClientTestingModule,
69 { provide: JWT_OPTIONS, useValue: JWT_OPTIONS },
77 fixture = TestBed.createComponent(MsInstancesComponent);
78 component = fixture.componentInstance;
79 fixture.detectChanges();
82 it('should create', () => {
83 expect(component).toBeTruthy();
86 it(`should fill msInstances Object`, () => {
87 const fixture = TestBed.createComponent(MsInstancesComponent);
88 const app = fixture.debugElement.componentInstance;
90 let mockMsInstance = [{
97 id: 'testBaseMsId1234',
103 scrumLeadId: 'testId',
104 systemsEngineer: 'test',
105 systemsEngineerId: 'testId',
107 developerId: 'testId',
108 pstDueDate: '01-01-2020 12:00',
109 pstDueIteration: '1.1',
110 eteDueDate: '01-01-2020 12:00',
111 eteDueIteration: '1.1',
113 createdOn: '01-01-2020 12:00',
115 updatedOn: '01-01-2020 12:00',
122 app.fillTable(mockMsInstance)
124 expect(app.loadTable).toEqual(true);
125 expect(app.msInstances.length).toEqual(1);