Skip to content

Commit

Permalink
fix(availability.spec.ts, lookup.service.spec.ts, shipping.service.sp…
Browse files Browse the repository at this point in the history
…ec.ts, location.ts, schedule.ts): update faker method for generating street address to use faker.location.streetAddress() instead of faker.address.streetAddress()
  • Loading branch information
jamalsoueidan committed Oct 12, 2023
1 parent a8ad56a commit ba435bf
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/functions/customer/services/availability.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jest.mock("~/functions/lookup", () => {
origin: {
name: faker.person.firstName(),
customerId: faker.number.int({ min: 1, max: 100000 }),
fullAddress: faker.address.streetAddress(),
fullAddress: faker.location.streetAddress(),
distanceHourlyRate: faker.number.int({ min: 1, max: 5 }),
fixedRatePerKm: faker.number.int({ min: 1, max: 5 }),
minDistanceForFree: faker.number.int({ min: 1, max: 5 }),
},
destination: {
name: faker.person.firstName(),
fullAddress: faker.address.streetAddress(),
fullAddress: faker.location.streetAddress(),
},
duration: {
text: "14 mins",
Expand Down
2 changes: 1 addition & 1 deletion src/functions/lookup/lookup.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jest.mock("~/functions/location/services", () => {
_id: new mongoose.Types.ObjectId(),
name: faker.person.firstName(),
customerId: faker.number.int({ min: 1, max: 100000 }),
fullAddress: faker.address.streetAddress(),
fullAddress: faker.location.streetAddress(),
distanceHourlyRate: faker.number.int({ min: 1, max: 5 }),
fixedRatePerKm: faker.number.int({ min: 1, max: 5 }),
minDistanceForFree: faker.number.int({ min: 1, max: 5 }),
Expand Down
8 changes: 4 additions & 4 deletions src/functions/shipping/shipping.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ describe("ShippingService", () => {
origin: {
name: faker.person.firstName(),
customerId: faker.number.int({ min: 1, max: 100000 }),
fullAddress: faker.address.streetAddress(),
fullAddress: faker.location.streetAddress(),
distanceHourlyRate: 100,
fixedRatePerKm: 20,
minDistanceForFree: 5,
},
destination: {
name: faker.person.firstName(),
fullAddress: faker.address.streetAddress(),
fullAddress: faker.location.streetAddress(),
},
duration: {
text: "1 hour",
Expand All @@ -46,14 +46,14 @@ describe("ShippingService", () => {
origin: {
name: faker.person.firstName(),
customerId: faker.number.int({ min: 1, max: 100000 }),
fullAddress: faker.address.streetAddress(),
fullAddress: faker.location.streetAddress(),
distanceHourlyRate: 100,
fixedRatePerKm: 20,
minDistanceForFree: 5,
},
destination: {
name: faker.person.firstName(),
fullAddress: faker.address.streetAddress(),
fullAddress: faker.location.streetAddress(),
},
duration: {
text: "1 hour",
Expand Down
2 changes: 1 addition & 1 deletion src/library/jest/helpers/location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const getLocationObject = (props: Partial<Location> = {}): Location => ({
customerId: faker.number.int({ min: 1, max: 100000 }),
locationType: LocationTypes.ORIGIN,
originType: LocationOriginTypes.COMMERCIAL,
fullAddress: faker.address.streetAddress(),
fullAddress: faker.location.streetAddress(),
distanceHourlyRate: faker.number.int({ min: 1, max: 5 }),
fixedRatePerKm: faker.number.int({ min: 1, max: 5 }),
minDistanceForFree: faker.number.int({ min: 1, max: 5 }),
Expand Down
2 changes: 1 addition & 1 deletion src/library/jest/helpers/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const getScheduleObject = (
}));

return {
name: faker.random.word(),
name: faker.word.sample(),
customerId: faker.number.int(),
slots,
products,
Expand Down

0 comments on commit ba435bf

Please sign in to comment.