1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
import {HttpClientTestingModule} from "@angular/common/http/testing";
import {getTestBed, TestBed} from "@angular/core/testing";
import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing";
import {DynamicInputsService} from "../../dynamicInputs.service";
import {ConfigurationModelInfo} from "./configuration.model.info";
import {SharedTreeService} from "../../shared.tree.service";
describe('Vnf Model Info', () => {
let injector;
let _dynamicInputsService : DynamicInputsService;
let _sharedTreeService : SharedTreeService;
beforeAll(done => (async () => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule, NgReduxTestingModule],
providers: [
MockNgRedux,
SharedTreeService,
DynamicInputsService]
});
await TestBed.compileComponents();
injector = getTestBed();
_sharedTreeService = injector.get(SharedTreeService);
})().then(done).catch(done.fail));
test('ConfigurationModelInfo should be defined', () => {
expect(ConfigurationModelInfo).toBeDefined();
});
test('ConfigurationModelInfo should defined extra details', () => {
let configurationModelInfo: ConfigurationModelInfo = new ConfigurationModelInfo(_dynamicInputsService, _sharedTreeService);
expect(configurationModelInfo.name).toEqual('configurations');
expect(configurationModelInfo.type).toEqual('Configuration');
});
test('isEcompGeneratedNaming should return false', () => {
let configurationModelInfo: ConfigurationModelInfo = new ConfigurationModelInfo(_dynamicInputsService, _sharedTreeService);
let isEcompGeneratedNaming: boolean = configurationModelInfo.isEcompGeneratedNaming();
expect(isEcompGeneratedNaming).toBeTruthy();
});
test('getTooltip should return "Configuration"', () => {
let configurationModelInfo: ConfigurationModelInfo = new ConfigurationModelInfo(_dynamicInputsService, _sharedTreeService);
let tooltip: string = configurationModelInfo.getTooltip();
expect(tooltip).toEqual('Configuration');
});
test('getType should return "Configuration"', () => {
let configurationModelInfo: ConfigurationModelInfo = new ConfigurationModelInfo(_dynamicInputsService, _sharedTreeService);
let tooltip: string = configurationModelInfo.getType();
expect(tooltip).toEqual('Configuration');
});
test('getModel should return Configuration model', () => {
let configurationModelInfo: ConfigurationModelInfo = new ConfigurationModelInfo(_dynamicInputsService, _sharedTreeService);
let model = configurationModelInfo.getModel({ uuid: 'foo' });
expect(model.uuid).toEqual('foo');
});
});
|