GitHub

MockDaffConfigurableProductFacade

class

import { MockDaffConfigurableProductFacade } from '@daffodil/product-configurable/state/testing'

@Injectable()
class MockDaffConfigurableProductFacade implements DaffConfigurableProductFacadeInterface {
  getAllAttributes(id: string): BehaviorSubject<Dictionary<string[]>>
  getAllVariants(id: string): BehaviorSubject<DaffConfigurableProductVariant[]>
  getAppliedAttributes(id: string): BehaviorSubject<Dictionary<string>>
  getMinimumPrice(id: string): BehaviorSubject<number>
  getMaximumPrice(id: string): BehaviorSubject<number>
  getMinimumDiscountedPrice(id: string): BehaviorSubject<number>
  getMaximumDiscountedPrice(id: string): BehaviorSubject<number>
  getMinimumPercentDiscount(id: string): BehaviorSubject<number>
  getMaximumPercentDiscount(id: string): BehaviorSubject<number>
  isPriceRanged(id: string): BehaviorSubject<boolean>
  hasDiscount(id: string): BehaviorSubject<boolean>
  getSelectableAttributes(id: string): BehaviorSubject<Dictionary<string[]>>
  getMatchingVariants(id: string): BehaviorSubject<DaffConfigurableProductVariant[]>
  dispatch(action): void
}

() Methods

getAllAttributes
BehaviorSubject>

All attributes of a configurable product.

Parameters
Parameterid: string
Description
getAllVariants
BehaviorSubject<DaffConfigurableProductVariant[]>

All variants of a configurable product.

Parameters
Parameterid: string
Description
getAppliedAttributes
BehaviorSubject>

The applied attributes of a configurable product.

Parameters
Parameterid: string
Description
getMinimumPrice
BehaviorSubject

Get the current minimum price possible based on the applied attributes and remaining variants.

Parameters
Parameterid: string
Description
getMaximumPrice
BehaviorSubject

Get the current maximum price possible based on the applied attributes and remaining variants.

Parameters
Parameterid: string
Description
getMinimumDiscountedPrice
BehaviorSubject

Get the current minimum discounted price possible based on the applied attributes and remaining variants.

Parameters
Parameterid: string
Description
getMaximumDiscountedPrice
BehaviorSubject

Get the current maximum discounted price possible based on the applied attributes and remaining variants.

Parameters
Parameterid: string
Description
getMinimumPercentDiscount
BehaviorSubject

Get the current minimum percent discount possible based on the applied attributes and remaining variants.

Parameters
Parameterid: string
Description
getMaximumPercentDiscount
BehaviorSubject

Get the current maximum percent discount possible based on the applied attributes and remaining variants.

Parameters
Parameterid: string
Description
isPriceRanged
BehaviorSubject

Returns whether the possible price for the configurable product is a range of different prices

Parameters
Parameterid: string
Description
hasDiscount
BehaviorSubject

Returns whether the variants of the configurable product have (a) discount(s)

Parameters
Parameterid: string
Description
getSelectableAttributes
BehaviorSubject>

Selectable configurable product attributes derived from the remaining variants and the order of currently applied attributes. The remaining variants of the product are derived from the currently applied attributes.

Parameters
Parameterid: string
Description
getMatchingVariants
BehaviorSubject<DaffConfigurableProductVariant[]>

The variants that match the applied attributes of a configurable product.

Parameters
Parameterid: string
Description
dispatch
void
Parameters
Parameteraction: undefined
Description