All files / src/app/shared/components/basket/basket-shipping-method basket-shipping-method.component.ts

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

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 215x                     5x           1x      
import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core';
import { Requisition } from 'projects/requisition-management/src/app/models/requisition/requisition.model';
 
import { Basket } from 'ish-core/models/basket/basket.model';
import { Order } from 'ish-core/models/order/order.model';
 
@Component({
  selector: 'ish-basket-shipping-method',
  templateUrl: './basket-shipping-method.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class BasketShippingMethodComponent implements OnChanges {
  @Input({ required: true }) data: Basket | Order | Requisition;
 
  desiredDeliveryDate: string;
 
  ngOnChanges(): void {
    this.desiredDeliveryDate = this.data.attributes?.find(attr => attr.name === 'desiredDeliveryDate')?.value as string;
  }
}