Skip to content

Commit

Permalink
Fix: test error
Browse files Browse the repository at this point in the history
  • Loading branch information
kmc7468 committed Nov 29, 2024
1 parent 3af8bf7 commit 372ecab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions test/services/reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe("[reports] 1.createHandler", () => {
const testRoom = await roomGenerator("test1", testData);
const msg = "User/report : report successful";
let req = httpMocks.createRequest({
userId: testUser1.id,
userOid: testUser1._id,
body: {
reportedId: testUser2._id,
type: "etc-reason",
Expand All @@ -41,7 +41,7 @@ describe("[reports] 2.searchByUserHandler", () => {
it("should return correct reporting/reported reports of users", async () => {
const testUser1 = await userModel.findOne({ id: "test1" });
let req = httpMocks.createRequest({
userId: testUser1.id,
userOid: testUser1._id,
});
let res = httpMocks.createResponse();
await reportHandlers.searchByUserHandler(req, res);
Expand Down
14 changes: 7 additions & 7 deletions test/services/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe("[rooms] 1.createHandler", () => {
time: Date.now() + 60 * 1000,
maxPartLength: 4,
},
userId: testUser1.id,
userOid: testUser1._id,
app,
});
let res = httpMocks.createResponse();
Expand All @@ -51,7 +51,7 @@ describe("[rooms] 2.infoHandler", () => {
const testRoom = await roomModel.findOne({ name: "test-room" });
let req = httpMocks.createRequest({
query: { id: testRoom._id },
userId: testUser1.id,
userOid: testUser1._id,
});
let res = httpMocks.createResponse();
await roomsHandlers.infoHandler(req, res);
Expand Down Expand Up @@ -87,7 +87,7 @@ describe("[rooms] 4.joinHandler", () => {
body: {
roomId: testRoom._id,
},
userId: testUser2.id,
userOid: testUser2._id,
app,
});
let res = httpMocks.createResponse();
Expand Down Expand Up @@ -129,7 +129,7 @@ describe("[rooms] 6.searchByUserHandler", () => {
it("should return information of searching room", async () => {
const testUser1 = await userModel.findOne({ id: "test1" });
let req = httpMocks.createRequest({
userId: testUser1.id,
userOid: testUser1._id,
});
let res = httpMocks.createResponse();
await roomsHandlers.searchByUserHandler(req, res);
Expand All @@ -147,7 +147,7 @@ describe("[rooms] 7.commitSettlementHandler", () => {
const testRoom = await roomModel.findOne({ name: "test-room" });
let req = httpMocks.createRequest({
body: { roomId: testRoom._id },
userId: testUser1.id,
userOid: testUser1._id,
timestamp: Date.now() + 60 * 1000,
app,
});
Expand All @@ -168,7 +168,7 @@ describe("[rooms] 8.commitPaymentHandler", () => {
const testRoom = await roomModel.findOne({ name: "test-room" });
let req = httpMocks.createRequest({
body: { roomId: testRoom._id },
userId: testUser2.id,
userOid: testUser2._id,
app,
});
let res = httpMocks.createResponse();
Expand All @@ -188,7 +188,7 @@ describe("[rooms] 9.abortHandler", () => {
const testRoom = await roomModel.findOne({ name: "test-room" });
let req = httpMocks.createRequest({
body: { roomId: testRoom._id },
userId: testUser2.id,
userOid: testUser2._id,
session: {},
app,
});
Expand Down
12 changes: 6 additions & 6 deletions test/services/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("[users] 1.agreeOnTermsOfServiceHandler", () => {
const msg =
"Users/agreeOnTermsOfService : agree on Terms of Service successful";
let req = httpMocks.createRequest({
userId: testUser1.id,
userOid: testUser1._id,
});
let res = httpMocks.createResponse();
await usersHandlers.agreeOnTermsOfServiceHandler(req, res);
Expand All @@ -33,7 +33,7 @@ describe("[users] 2.getAgreeOnTermsOfServiceHandler", () => {
it("should return AgreeOnTermsOfService of user", async () => {
const testUser1 = await userModel.findOne({ id: "test1" });
let req = httpMocks.createRequest({
userId: testUser1.id,
userOid: testUser1._id,
});
let res = httpMocks.createResponse();
await usersHandlers.getAgreeOnTermsOfServiceHandler(req, res);
Expand All @@ -52,7 +52,7 @@ describe("[users] 3.editNicknameHandler", () => {
const testUser1 = await userModel.findOne({ id: "test1" });
const msg = "Users/editNickname : edit user nickname successful";
let req = httpMocks.createRequest({
userId: testUser1.id,
userOid: testUser1._id,
body: {
nickname: testNickname,
},
Expand All @@ -79,7 +79,7 @@ describe("[users] 4.editAccountHandler", () => {
const testUser1 = await userModel.findOne({ id: "test1" });
const msg = "Users/editAccount : edit user account successful";
let req = httpMocks.createRequest({
userId: testUser1.id,
userOid: testUser1._id,
body: {
account: testAccount,
},
Expand All @@ -105,7 +105,7 @@ describe("[users] 5.editProfileImgGetPUrlHandler", () => {
const testUser1 = await userModel.findOne({ id: "test1" });
const testImgType = "image/jpg";
let req = httpMocks.createRequest({
userId: testUser1.id,
userOid: testUser1._id,
body: {
type: testImgType,
},
Expand All @@ -129,7 +129,7 @@ describe("[users] 6.editProfileImgDoneHandler", () => {
it("should return correct result and new profileImageUrl", async () => {
const testUser1 = await userModel.findOne({ id: "test1" });
let req = httpMocks.createRequest({
userId: testUser1.id,
userOid: testUser1._id,
});
let res = httpMocks.createResponse();
await usersHandlers.editProfileImgDoneHandler(req, res);
Expand Down

0 comments on commit 372ecab

Please sign in to comment.