GitHub

MockDaffProductFacade

import { MockDaffProductFacade } from '@daffodil/product/state/testing'
@Injectable()
class MockDaffProductFacade implements DaffProductFacadeInterface {
  getProduct(id: string): BehaviorSubject<DaffProduct>
  getPrice(id: string): BehaviorSubject<number>
  hasDiscount(id: string): BehaviorSubject<boolean>
  getDiscountAmount(id: string): BehaviorSubject<number>
  getDiscountedPrice(id: string): BehaviorSubject<number>
  getDiscountPercent(id: string): BehaviorSubject<number>
  isOutOfStock(id: string): BehaviorSubject<boolean>
  dispatch(action)
}

Properties

Name Type Description
getProduct BehaviorSubject<DaffProduct>

Get a product.

getPrice BehaviorSubject<number>

Get the original price for a product.

hasDiscount BehaviorSubject<boolean>

Whether a particular product has a discount.

getDiscountAmount BehaviorSubject<number>

Get the discount amount of a product.

getDiscountedPrice BehaviorSubject<number>

Get the discounted price for a product.

getDiscountPercent BehaviorSubject<number>

Get the discount percent of a product.

isOutOfStock BehaviorSubject<boolean>

Whether a product is out of stock.

dispatch