GitHub

MockProductReview

import { MockProductReview } from '@daffodil/reviews/testing'

Mocked DaffProductReview object.

class MockProductReview implements DaffProductReview {
  overallRating: faker.datatype.number({ min: 1, max: 100 }) = faker.datatype.number({ min: 1, max: 100 })
  id: faker.datatype.uuid() = faker.datatype.uuid()
  productId: faker.datatype.uuid() = faker.datatype.uuid()
  createdAt: faker.date.past(10).toISOString() = faker.date.past(10).toISOString()
  title: faker.random.word() = faker.random.word()
  body: faker.random.words(10) = faker.random.words(10)
  ratings: DaffReviewRating[] = this.createRatings()
  customer: DaffProductReviewCustomer = this.createCustomer()
  protected ratingFactory: DaffReviewRatingFactory
  protected customerFactory: DaffProductReviewCustomerFactory
}