diff --git a/projects/cps-ui-kit/src/lib/components/cps-input/cps-input.component.html b/projects/cps-ui-kit/src/lib/components/cps-input/cps-input.component.html index 50dbaf67..bde8d71c 100644 --- a/projects/cps-ui-kit/src/lib/components/cps-input/cps-input.component.html +++ b/projects/cps-ui-kit/src/lib/components/cps-input/cps-input.component.html @@ -1,9 +1,11 @@
- @if (label) { + @if (label || infoTooltip) {
- + @if (label) { + + } @if (infoTooltip) { { expect(hint?.textContent?.trim()).toBe('Helper text'); }); + it('should display info tooltip without label', () => { + fixture.componentRef.setInput('label', ''); + fixture.componentRef.setInput('infoTooltip', 'More information'); + fixture.detectChanges(); + + const label = fixture.nativeElement.querySelector('label'); + const infoTooltip = fixture.nativeElement.querySelector( + '.cps-input-label-info-circle' + ); + + expect(label).toBeNull(); + expect(infoTooltip).toBeTruthy(); + }); + it('should change input type', () => { component.type = 'password'; component.ngOnInit();