Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:atlp-rwanda/e-commerce-ninjas-bn…
Browse files Browse the repository at this point in the history
… into fixes
  • Loading branch information
Aime-Patrick committed Aug 5, 2024
2 parents 0869546 + b241ee5 commit 4756042
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 4 deletions.
47 changes: 46 additions & 1 deletion src/databases/seeders/20240520202759-users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import {
userElevenId,
userTwelveId,
userThirteenId,
userFourTeenId,
userFiveTeenId,
} from "../../types/uuid";

const userOne = {
Expand Down Expand Up @@ -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: "[email protected]",
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: "[email protected]",
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", [
Expand All @@ -301,7 +344,9 @@ export const up = (queryInterface: QueryInterface) =>
userTen,
userEleven,
userTwelve,
userThirteen
userThirteen,
userFourteen,
userFiveTeen
]);

export const down = async (queryInterface: QueryInterface) => {
Expand Down
4 changes: 2 additions & 2 deletions src/databases/seeders/20240601224834-shops.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion src/modules/product/test/product.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/types/uuid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 4756042

Please sign in to comment.