import { DaffCategoryFactory } from '@daffodil/category/testing'
A factory for creating a DaffCategory
.
@Injectable()
class DaffCategoryFactory extends DaffModelFactory<DaffCategory, typeof MockCategory> {
createTree(
depth: number
productIds: string[] = []
partial: Partial<DaffCategory> = {}
): DaffCategory
}
DaffCategory
Creates a category tree of specified depth, optionally using the passed product IDs. This is very useful for creating a category tree that closely resembles those found in the wild. Each child has a minimum of half of the parent's products.
Parameter | depth: number |
---|---|
Description |
Parameter | productIds: string[] |
---|---|
Default | [] |
Description |
Parameter | partial: Partial<DaffCategory> |
---|---|
Default | {} |
Description |