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

OZG-2737 OZG-3072 set default for userprofile

parent 4c6820a9
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,6 @@ describe('LinkWithUserNameTooltipComponent', () => {
fixture = TestBed.createComponent(LinkWithUserNameTooltipComponent);
component = fixture.componentInstance;
component.tooltipTemplate = tooltipTemplate;
component.userProfile = createStateResource(userProfile);
fixture.detectChanges();
});
......@@ -35,6 +34,15 @@ describe('LinkWithUserNameTooltipComponent', () => {
expect(component).toBeTruthy();
});
describe('ngOnInit', () => {
it('should build tooltip with empty userProfile', () => {
component.ngOnInit();
expect(component.tooltip).toEqual('TooltipTemplate with placeholder undefined undefined');
})
})
describe('tooltip', () => {
it('should be build with replaced placefolders', () => {
......
import { Component, Input, OnInit } from '@angular/core';
import { isNotNil, replacePlaceholders, StateResource } from '@goofy-client/tech-shared';
import { createEmptyStateResource, isNotNil, replacePlaceholders, StateResource } from '@goofy-client/tech-shared';
import { UserProfileResource } from '@goofy-client/user-profile-shared';
@Component({
......@@ -11,7 +11,7 @@ export class LinkWithUserNameTooltipComponent implements OnInit {
@Input() routerLinkString: string;
@Input() tooltipTemplate: string;
@Input() userProfile: StateResource<UserProfileResource>;
@Input() userProfile: StateResource<UserProfileResource> = createEmptyStateResource();
tooltip: string;
......
......@@ -25,7 +25,6 @@ describe('TextWithUserNameTooltipComponent', () => {
fixture = TestBed.createComponent(TextWithUserNameTooltipComponent);
component = fixture.componentInstance;
component.tooltipTemplate = tooltipTemplate;
component.userProfile = createStateResource(userProfile);
fixture.detectChanges();
});
......@@ -33,6 +32,15 @@ describe('TextWithUserNameTooltipComponent', () => {
expect(component).toBeTruthy();
});
describe('ngOnInit', () => {
it('should build tooltip with empty userProfile', () => {
component.ngOnInit();
expect(component.tooltip).toEqual('TooltipTemplate with placeholder undefined undefined');
})
})
describe('tooltip', () => {
it('should be build with replaced placefolders', () => {
......
import { Component, Input, OnInit } from '@angular/core';
import { isNotNil, replacePlaceholders, StateResource } from '@goofy-client/tech-shared';
import { createEmptyStateResource, isNotNil, replacePlaceholders, StateResource } from '@goofy-client/tech-shared';
import { UserProfileResource } from '@goofy-client/user-profile-shared';
@Component({
......@@ -11,7 +11,7 @@ export class TextWithUserNameTooltipComponent implements OnInit {
@Input() tooltipTemplate: string;
@Input() text: string;
@Input() userProfile: StateResource<UserProfileResource>;
@Input() userProfile: StateResource<UserProfileResource> = createEmptyStateResource();
tooltip: string;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment