All files / app/components/header/change-lang change-lang.component.ts

100% Statements 8/8
100% Branches 2/2
100% Functions 3/3
100% Lines 7/7

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            1x 1x                     1x 24x   24x     3x 3x      
import { ChangeDetectionStrategy, Component } from '@angular/core';
 
import { TranslateService } from '@ngx-translate/core';
 
import { ChangeLangImports } from './change-lang.imports';
 
export enum Languages {
  pl = 'pl', en = 'en'
}
 
@Component({
  selector: 'app-change-lang',
  templateUrl: './change-lang.component.html',
  styleUrls: ['./change-lang.component.scss'],
  standalone: true,
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [ChangeLangImports.imports],
})
export class ChangeLangComponent {
  protected readonly languages = Languages;
 
  constructor(private translate: TranslateService) {}
 
  protected changeLang(lang: string, elementToFocus: HTMLButtonElement): void {
    this.translate.use(lang);
    elementToFocus.focus();
  }
}