diff --git a/src/databases/seeders/20240520202759-users.ts b/src/databases/seeders/20240520202759-users.ts index 562d081f..f1f4f072 100644 --- a/src/databases/seeders/20240520202759-users.ts +++ b/src/databases/seeders/20240520202759-users.ts @@ -15,6 +15,8 @@ import { userElevenId, userTwelveId, userThirteenId, + userFourTeenId, + userFiveTeenId, } from "../../types/uuid"; const userOne = { @@ -286,6 +288,47 @@ const userThirteen = { isVerified: true, is2FAEnabled: false }; +const userFourteen = { + id: userFourTeenId, + createdAt: new Date(), + updatedAt: new Date(), + passwordUpdatedAt: new Date(), + firstName: "F Seller14", + lastName: "L Seller14", + email: "seller14@gmail.com", + password: hashPassword("Password@123"), + phone: 25089767899, + profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg", + gender: "female", + birthDate: "2014-02-02", + language: "english", + currency: "USD", + role: "seller", + status: "enabled", + isVerified: true, + is2FAEnabled: false, +}; + +const userFiveTeen = { + id: userFiveTeenId, + createdAt: new Date(), + updatedAt: new Date(), + passwordUpdatedAt: new Date(), + firstName: "F Seller", + lastName: "L Seller", + email: "seller15@gmail.com", + password: hashPassword("Password@123"), + phone: 25089767099, + profilePicture: "https://res.cloudinary.com/djrmfg6k9/image/upload/v1720294521/cce1ffu7uw3j2vg9s2vl.jpg", + gender: "male", + birthDate: "2-2-2014", + language: "english", + currency: "USD", + role: "seller", + status: "enabled", + isVerified: true, + is2FAEnabled: false, +}; export const up = (queryInterface: QueryInterface) => queryInterface.bulkInsert("users", [ @@ -301,7 +344,9 @@ export const up = (queryInterface: QueryInterface) => userTen, userEleven, userTwelve, - userThirteen + userThirteen, + userFourteen, + userFiveTeen ]); export const down = async (queryInterface: QueryInterface) => { diff --git a/src/databases/seeders/20240601224834-shops.ts b/src/databases/seeders/20240601224834-shops.ts index 7d7104cb..176085cd 100644 --- a/src/databases/seeders/20240601224834-shops.ts +++ b/src/databases/seeders/20240601224834-shops.ts @@ -1,5 +1,5 @@ import { QueryInterface } from "sequelize"; -import { shopFourId, shopOneId, shopThreeId, shopTwoId, userFourId, userSevenId, userSixId } from "../../types/uuid"; +import { shopFourId, shopOneId, shopThreeId, shopTwoId, userFourId, userFourTeenId, userSevenId, userSixId } from "../../types/uuid"; const shopOne = { id: shopOneId, @@ -22,7 +22,7 @@ const shopTwo = { const shopThree = { id: shopThreeId, name: "Shoes Shop 509", - userId: userFourId, + userId: userFourTeenId, description: "Selling", createdAt: new Date(), updatedAt: new Date() diff --git a/src/modules/product/test/product.spec.ts b/src/modules/product/test/product.spec.ts index c5082e60..59f5053a 100644 --- a/src/modules/product/test/product.spec.ts +++ b/src/modules/product/test/product.spec.ts @@ -446,7 +446,7 @@ describe("internal server error", () => { before((done) => { router() .post("/api/auth/login") - .send({ email: "seller3@gmail.com", password: "Password@123" }) + .send({ email: "seller15@gmail.com", password: "Password@123" }) .end((err, res) => { token = res.body.data.token; done(err); @@ -465,6 +465,7 @@ describe("internal server error", () => { description: "A new Shops description", }) .end((err, res) => { + console.log(res) expect(res).to.have.status(httpStatus.INTERNAL_SERVER_ERROR); expect(res.body).to.have.property("message"); done(err); diff --git a/src/types/uuid.ts b/src/types/uuid.ts index 347977df..62462dbb 100644 --- a/src/types/uuid.ts +++ b/src/types/uuid.ts @@ -13,6 +13,8 @@ export const userTenId = uuidv4(); export const userElevenId = uuidv4(); export const userTwelveId = uuidv4(); export const userThirteenId = uuidv4(); +export const userFourTeenId = uuidv4(); +export const userFiveTeenId = uuidv4(); export const shopOneId = uuidv4(); export const shopTwoId = uuidv4();