All files / src/app/shared/components/basket/basket-validation-items basket-validation-items.component.ts

100% Statements 4/4
100% Branches 0/0
100% Functions 2/2
100% Lines 4/4

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 292x                             2x   4x               1x      
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
 
import { LineItemView } from 'ish-core/models/line-item/line-item.model';
 
/**
 * Displays the basket validation result items, e.g. items that cannot be shipped to the basket shipping address.
 *
 * @example
 * <ish-basket-validation-items [lineItems]="undeliverableItems" (deleteItem)="deleteItem($event)"></ish-basket-validation-items>
 */
@Component({
  selector: 'ish-basket-validation-items',
  templateUrl: './basket-validation-items.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class BasketValidationItemsComponent {
  @Input({ required: true }) lineItems: LineItemView[];
  @Output() deleteItem = new EventEmitter<string>();
 
  /**
   * Throws deleteItem event when delete button was clicked.
   *
   * @param itemId The id of the item that should be deleted.
   */
  onDeleteItem(itemId: string) {
    this.deleteItem.emit(itemId);
  }
}