Newer
Older
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
62
63
64
import { Component, Input } from '@angular/core';
import { TestBed, waitForAsync, ComponentFixture } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { provideMockStore, MockStore } from '@ngrx/store/testing';
import { WelcomeComponent } from './welcome.component';
import { AppConfigService } from 'src/app/app-config.service';
describe('WelcomeComponent', () => {
let component: WelcomeComponent;
let fixture: ComponentFixture<WelcomeComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [RouterTestingModule],
declarations: [WelcomeComponent]
}).compileComponents();
fixture = TestBed.createComponent(WelcomeComponent);
component = fixture.componentInstance;
}));
it('should create the component', () => {
expect(component).toBeDefined();
});
it('#getLogoSrc() should return logo URL address', () => {
component.apiUrl = 'http://test.com';
component.instance = {
name: 'myInstance',
label: 'My Instance',
data_path: 'data/path',
config: {
design: {
design_color: 'green',
design_background_color: 'darker green',
design_logo: 'path/to/logo',
design_favicon: 'path/to/favicon'
},
home: {
home_component: 'HomeComponent',
home_config: {
home_component_text: 'Description',
home_component_logo: 'path/to/logo'
}
},
search: {
search_by_criteria_allowed: true,
search_by_criteria_label: 'Search',
search_multiple_allowed: true,
search_multiple_label: 'Search multiple',
search_multiple_all_datasets_selected: true
},
documentation: {
documentation_allowed: true,
documentation_label: 'Documentation'
}
},
nb_dataset_families: 1,
nb_datasets: 2
};
expect(component.getLogoSrc()).toBe('http://test.com/download-instance-file/myInstance/path/to/logo');
});
});