[ACA-3317] Split About component into smaller components (#5708)

This commit is contained in:
davidcanonieto
2020-05-18 09:39:58 +01:00
committed by GitHub
parent 22acd3f6e6
commit 1def8000f0
11 changed files with 142 additions and 59 deletions

View File

@@ -19,13 +19,11 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CoreTestingModule } from '../../testing/core.testing.module';
import { setupTestBed } from '../../testing/setup-test-bed';
import { AboutGithubLinkComponent } from './about-github-link.component';
import { AppConfigService } from '../../app-config/app-config.service';
import { aboutGithubDetails } from '../about.mock';
describe('AboutGithubLinkComponent', () => {
let fixture: ComponentFixture<AboutGithubLinkComponent>;
let component: AboutGithubLinkComponent;
let appConfigService: AppConfigService;
setupTestBed({
imports: [CoreTestingModule]
@@ -34,14 +32,6 @@ describe('AboutGithubLinkComponent', () => {
beforeEach(() => {
fixture = TestBed.createComponent(AboutGithubLinkComponent);
component = fixture.componentInstance;
appConfigService = TestBed.get(AppConfigService);
appConfigService.config = Object.assign(appConfigService.config, {
'ecmHost': aboutGithubDetails.ecmHost,
'bpmHost': aboutGithubDetails.bpmHost,
'application': {
'name': aboutGithubDetails.appName
}
});
fixture.detectChanges();
});
@@ -49,7 +39,10 @@ describe('AboutGithubLinkComponent', () => {
fixture.destroy();
});
it('Should fetch appName for app.config and display as title', () => {
it('Should fetch appName for app.config and display as title', async () => {
component.application = 'mock-application-name';
fixture.detectChanges();
await fixture.whenStable();
const titleElement = fixture.nativeElement.querySelector('[data-automation-id="adf-github-app-title"]');
expect(titleElement === null).toBeFalsy();
expect(titleElement.innerText).toEqual('mock-application-name');
@@ -77,11 +70,4 @@ describe('AboutGithubLinkComponent', () => {
const githubUrl = fixture.nativeElement.querySelector('[data-automation-id="adf-github-url"]');
expect(githubUrl.innerText).toEqual(aboutGithubDetails.url);
});
it('should fetch process and content hosts from the app.config.json file', async() => {
await fixture.whenStable();
expect(component.application).toEqual(aboutGithubDetails.appName);
expect(component.bpmHost).toEqual(aboutGithubDetails.bpmHost);
expect(component.ecmHost).toEqual(aboutGithubDetails.ecmHost);
});
});