reply message from thread and room
This commit is contained in:
@@ -20,7 +20,7 @@ const boxId = 1;
|
||||
jest.mock("../../db/utils/mail", () => {
|
||||
return {
|
||||
findRoomByOwner: jest.fn(),
|
||||
getAddresseId: jest.fn(),
|
||||
getAddressId: jest.fn(),
|
||||
getUserIdOfMailbox: jest.fn(),
|
||||
};
|
||||
});
|
||||
@@ -38,7 +38,7 @@ jest.mock("../../db/message/saveMessage-db", () => {
|
||||
getThreadInfoOnId: jest.fn(),
|
||||
};
|
||||
});
|
||||
import { getAddresseId, getUserIdOfMailbox, findRoomByOwner } from "../../db/utils/mail";
|
||||
import { getAddressId, getUserIdOfMailbox, findRoomByOwner } from "../../db/utils/mail";
|
||||
import {
|
||||
createRoom,
|
||||
registerMessageInRoom,
|
||||
@@ -69,7 +69,7 @@ import { AttrsWithEnvelopeTest, createReplyWithSameMembers } from "../test-utils
|
||||
// if only me reply -> channel
|
||||
|
||||
beforeAll(async () => {
|
||||
mocked(getAddresseId).mockImplementation(db.getAddresseId);
|
||||
mocked(getAddressId).mockImplementation(db.getAddressId);
|
||||
mocked(getUserIdOfMailbox).mockImplementation(db.getUserIdOfMailbox);
|
||||
mocked(findRoomByOwner).mockImplementation(db.findRoomByOwner);
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ export default class saveMessageDatabase {
|
||||
});
|
||||
};
|
||||
|
||||
getAddresseId = (email: string, name?: string): Promise<number> => {
|
||||
getAddressId = (email: string, name?: string): Promise<number> => {
|
||||
const match = this.users.find((user) => user.user.mailbox + "@" + user.user.host == email);
|
||||
return new Promise((resolve, reject) => resolve(match?.id));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user