3 * ============LICENSE_START=======================================================
4 * Copyright (C) 2022 Nordix Foundation.
5 * ================================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * SPDX-License-Identifier: Apache-2.0
19 * ============LICENSE_END=========================================================
22 import {async, ComponentFixture, TestBed} from '@angular/core/testing';
24 import {InputListComponent} from './input-list.component';
25 import {TranslateModule} from '../../../../../shared/translator/translate.module';
26 import {Component, Input} from '@angular/core';
27 import {DataTypeModel} from '../../../../../../models/data-types';
28 import {TranslateService} from '../../../../../shared/translator/translate.service';
30 @Component({selector: 'app-input-list-item', template: ''})
31 class InputListItemStubComponent {
32 @Input() name: string;
33 @Input() type: DataTypeModel;
34 @Input() dataTypeMap: any;
35 @Input() valueObjRef: any;
37 @Input() allowDeletion: any;
38 @Input() isViewOnly: boolean;
41 const translateServiceMock: Partial<TranslateService> = {
42 translate: jest.fn((str: string) => {
46 describe('InputListComponent', () => {
47 let component: InputListComponent;
48 let fixture: ComponentFixture<InputListComponent>;
50 beforeEach(async(() => {
51 TestBed.configureTestingModule({
52 declarations: [ InputListComponent, InputListItemStubComponent ],
53 imports: [ TranslateModule ],
55 { provide: TranslateService, useValue: translateServiceMock }
62 fixture = TestBed.createComponent(InputListComponent);
63 component = fixture.componentInstance;
64 fixture.detectChanges();
67 it('should create', () => {
68 expect(component).toBeDefined();