All files / src/app/extensions/quoting/shared/quote-interactions quote-interactions.component.ts

63.63% Statements 7/11
75% Branches 3/4
33.33% Functions 2/6
63.63% Lines 7/11

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 33 34 35 36 37 38 39 40 413x     3x               3x         1x     1x 1x 1x                                      
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
 
import { QuoteContextFacade, isQuoteValid } from '../../facades/quote-context.facade';
import { Quote, QuoteRequest, QuoteStatus } from '../../models/quoting/quoting.model';
 
@Component({
  selector: 'ish-quote-interactions',
  templateUrl: './quote-interactions.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class QuoteInteractionsComponent implements OnInit {
  quote$: Observable<Quote | QuoteRequest>;
  state$: Observable<QuoteStatus>;
  isQuoteValid$: Observable<boolean>;
 
  constructor(private context: QuoteContextFacade) {}
 
  ngOnInit() {
    this.quote$ = this.context.select('entity');
    this.state$ = this.context.select('state');
    this.isQuoteValid$ = this.context.select(isQuoteValid);
  }
 
  reject() {
    this.context.reject();
  }
 
  copy() {
    this.context.copy();
  }
 
  addToBasket() {
    this.context.addToBasket();
  }
 
  submit() {
    this.context.submit();
  }
}