All files / app/components/header/copy-text copy-text.component.ts

100% Statements 11/11
100% Branches 1/1
100% Functions 3/3
100% Lines 11/11

Kamil Chmielowski

Web / Angular

Jasmine code coverage report for cv app.

You can contact with me by email: kamilchmielowski94@gmail.com or my page.

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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                        1x 60x 60x 60x   60x   60x     4x 4x 4x 2x 2x          
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, HostBinding, Input } from '@angular/core';
 
import { CopyTextImports } from './copy-text.imports';
 
@Component({
  selector: 'app-copy-text',
  templateUrl: './copy-text.component.html',
  styleUrls: ['./copy-text.component.scss'],
  standalone: true,
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: CopyTextImports.imports,
})
export class CopyTextComponent {
  @Input({ required: true }) aria = '';
  @Input() copyText = '';
  @Input({ required: true }) text = '';
 
  @HostBinding('class.tooltip-visible') private tooltipVisible = false;
 
  constructor(private cdr: ChangeDetectorRef) {}
 
  showTooltip(): void {
    if (!this.tooltipVisible) {
      this.tooltipVisible = true;
      setTimeout(() => {
        this.tooltipVisible = false;
        this.cdr.markForCheck();
      }, 2000);
    }
  }
}