-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix-#Login: removed UserInfo field when user logs in
- Loading branch information
gisubizo Jovan
authored and
gisubizo Jovan
committed
May 24, 2024
1 parent
c709966
commit cd8a730
Showing
5 changed files
with
16 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ import User from "../src/sequelize/models/users"; | |
import bcrypt from "bcrypt"; | ||
import { Role } from "../src/sequelize/models/roles"; | ||
import { dummy } from "./prod"; | ||
import * as userServices from "../src/services/user.service" | ||
import { number } from "joi"; | ||
|
||
const queryInterface = sequelize.getQueryInterface(); | ||
|
||
|
@@ -86,7 +88,8 @@ describe("testing cart", () => { | |
// console.log("response 3--->", res3); | ||
|
||
sellerToken = res3.body.token; | ||
sellerId = res3.body.userInfo?.id; | ||
const seller = await userServices.getUserByEmail("[email protected]"); | ||
const sellerId = seller?.id; | ||
|
||
await request(app) | ||
.patch(`/api/v1/users/${sellerId}/role`) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,12 @@ import User from "../src/sequelize/models/users"; | |
import bcrypt from "bcryptjs"; | ||
import { Role } from "../src/sequelize/models/roles"; | ||
import { dummy } from "./prod"; | ||
import * as userServive from "../src/services/user.service" | ||
|
||
let buyerToken: any; | ||
let adminToken: any; | ||
let sellerToken: any; | ||
let sellerId: number; | ||
|
||
|
||
describe("test stripe api payment", () => { | ||
beforeAll(async () => { | ||
|
@@ -79,8 +80,11 @@ describe("test stripe api payment", () => { | |
email: "[email protected]", | ||
password: "password", | ||
}); | ||
|
||
const seller = await userServive.getUserByEmail("[email protected]"); | ||
sellerToken = sellerResponse.body.token; | ||
sellerId = sellerResponse.body.userInfo?.id; | ||
|
||
let sellerId = seller?.id; | ||
|
||
await request(app) | ||
.patch(`/api/v1/users/${sellerId}/role`) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters