All files / src/app/shared/cms/components/cms-product-list-manual cms-product-list-manual.component.ts

100% Statements 6/6
50% Branches 1/2
100% Functions 3/3
100% Lines 6/6

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 221x   1x               1x     1x     1x 2x        
import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core';
 
import { ContentPageletView } from 'ish-core/models/content-view/content-view.model';
import { CMSComponent } from 'ish-shared/cms/models/cms-component/cms-component.model';
 
@Component({
  selector: 'ish-cms-product-list-manual',
  templateUrl: './cms-product-list-manual.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CMSProductListManualComponent implements CMSComponent, OnChanges {
  @Input({ required: true }) pagelet: ContentPageletView;
 
  productSKUs: string[] = [];
 
  ngOnChanges() {
    this.productSKUs = this.pagelet.hasParam('Products')
      ? this.pagelet.configParam<string[]>('Products').map(product => product.split('@')[0])
      : [];
  }
}