Skip to content
Snippets Groups Projects
Commit a85b09e9 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-14 clear app.component; fix app.component test

parent a4dd7b8d
No related branches found
No related tags found
No related merge requests found
<ng-container *ngIf="apiRoot | async as _apiRoot">
<!-- <ng-container *ngIf="apiRoot | async as _apiRoot">
<div>
<p>Version: {{ _apiRoot.version }}</p>
<p>BuildTime: {{ _apiRoot.buildTime }}</p>
<p>JavaVersion: {{ _apiRoot.javaVersion }}</p>
</div>
</ng-container>
-->
\ No newline at end of file
......@@ -19,11 +19,4 @@ describe('AppComponent', () => {
const app = fixture.componentInstance;
expect(app.title).toEqual('goofy');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to goofy!');
});
});
import { Component } from '@angular/core';
import { ApiRootFacade } from '@goofy-client/api-root-shared';
import { ApiRootResource } from 'libs/api-root-shared/src/lib/api-root-shared.model';
import { Observable } from 'rxjs';
@Component({
selector: 'goofy-client-root',
......@@ -11,9 +8,9 @@ import { Observable } from 'rxjs';
export class AppComponent {
title = 'goofy';
apiRoot: Observable<ApiRootResource>;
/* apiRoot: Observable<ApiRootResource>;
constructor(apiRootFacade: ApiRootFacade) {
this.apiRoot = apiRootFacade.apiRoot;
}
} */
}
\ No newline at end of file
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { RestModule } from '@ngxp/rest';
import { NgxsModule } from '@ngxs/store';
......@@ -7,6 +8,7 @@ import { ApiRootState } from './api-root-shared.state';
@NgModule({
imports: [
CommonModule,
NgxsModule.forFeature([ApiRootState]),
RestModule
],
......
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { RestModule } from '@ngxp/rest';
import { NgxsModule } from '@ngxs/store';
import { EnvironmentState } from './environment-shared.state';
@NgModule({
imports: [NgxsModule.forFeature([EnvironmentState]), RestModule]
imports: [
CommonModule,
NgxsModule.forFeature([EnvironmentState]),
RestModule
]
})
export class EnvironmentSharedModule {}
import { isNil } from 'lodash-es';
export interface StateResource<T> {
reload: boolean;
loaded: boolean;
......@@ -26,3 +24,7 @@ export function doIfLoadingRequired(stateResource: StateResource<any>, runable:
export function isLoadingRequired(stateResource: StateResource<any>): boolean {
return !stateResource.loading && (!stateResource.loaded || stateResource.reload);
}
export function isNil(value: any){
return value === 'undefined' || value == null;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment