MockDaffConfigurableProductFacade
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)
}
Properties
Name | Type | Description |
---|---|---|
getAllAttributes | BehaviorSubject<Dictionary<string[]>> | All attributes of a configurable product. |
getAllVariants | BehaviorSubject<DaffConfigurableProductVariant[]> | All variants of a configurable product. |
getAppliedAttributes | BehaviorSubject<Dictionary<string>> | The applied attributes of a configurable product. |
getMinimumPrice | BehaviorSubject<number> | Get the current minimum price possible based on the applied attributes and remaining variants. |
getMaximumPrice | BehaviorSubject<number> | Get the current maximum price possible based on the applied attributes and remaining variants. |
getMinimumDiscountedPrice | BehaviorSubject<number> | Get the current minimum discounted price possible based on the applied attributes and remaining variants. |
getMaximumDiscountedPrice | BehaviorSubject<number> | Get the current maximum discounted price possible based on the applied attributes and remaining variants. |
getMinimumPercentDiscount | BehaviorSubject<number> | Get the current minimum percent discount possible based on the applied attributes and remaining variants. |
getMaximumPercentDiscount | BehaviorSubject<number> | Get the current maximum percent discount possible based on the applied attributes and remaining variants. |
isPriceRanged | BehaviorSubject<boolean> | Returns whether the possible price for the configurable product is a range of different prices |
hasDiscount | BehaviorSubject<boolean> | Returns whether the variants of the configurable product have (a) discount(s) |
getSelectableAttributes | BehaviorSubject<Dictionary<string[]>> | 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. |
getMatchingVariants | BehaviorSubject<DaffConfigurableProductVariant[]> | The variants that match the applied attributes of a configurable product. |
dispatch |