GitHub

MockProductReview

Mocked DaffProductReview object.

import { MockProductReview } from '@daffodil/reviews/testing'
class MockProductReview implements DaffProductReview {
  overallRating: faker.datatype.number({ min: 1, max: 100 })
  id: faker.datatype.uuid()
  productId: faker.datatype.uuid()
  createdAt: faker.date.past(10).toISOString()
  title: faker.random.word()
  body: faker.random.words(10)
  ratings: this.createRatings()
  customer: this.createCustomer()
  protected ratingFactory: DaffReviewRatingFactory
  protected customerFactory: DaffProductReviewCustomerFactory
}

Properties

Name Type Description
overallRating faker.datatype.number({ min: 1, max: 100 })
id faker.datatype.uuid()
productId faker.datatype.uuid()
createdAt faker.date.past(10).toISOString()
title faker.random.word()
body faker.random.words(10)
ratings this.createRatings()
customer this.createCustomer()
ratingFactory DaffReviewRatingFactory
customerFactory DaffProductReviewCustomerFactory