All files / src/app/shared/components/product/product-variation-select-enhanced product-variation-select-enhanced.component.ts

100% Statements 8/8
75% Branches 3/4
100% Functions 3/3
100% Lines 8/8

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 332x     2x 2x                 2x         5x       5x     5x       2x      
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Observable } from 'rxjs';
 
import { AppFacade } from 'ish-core/facades/app.facade';
import { VariationOptionGroup } from 'ish-core/models/product-variation/variation-option-group.model';
import { DeviceType } from 'ish-core/models/viewtype/viewtype.types';
 
@Component({
  selector: 'ish-product-variation-select-enhanced',
  templateUrl: './product-variation-select-enhanced.component.html',
  styleUrls: ['./product-variation-select-enhanced.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ProductVariationSelectEnhancedComponent implements OnInit {
  @Input({ required: true }) group: VariationOptionGroup;
  @Input() uuid: string;
  @Input() multipleOptions: boolean;
 
  @Output() changeOption = new EventEmitter<{ group: string; value: string }>();
 
  deviceType$: Observable<DeviceType>;
 
  constructor(private appFacade: AppFacade) {}
 
  ngOnInit() {
    this.deviceType$ = this.appFacade.deviceType$;
  }
 
  optionChange(group: string, value: string) {
    this.changeOption.emit({ group, value });
  }
}