chore: format web monitor inbox tests
This commit is contained in:
parent
6fa437613b
commit
4c14d6c8db
@ -113,7 +113,12 @@ describe("web monitor inbox", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onMessage = vi.fn();
|
const onMessage = vi.fn();
|
||||||
const listener = await monitorWebInbox({ verbose: false, accountId: ACCOUNT_ID, authDir, onMessage });
|
const listener = await monitorWebInbox({
|
||||||
|
verbose: false,
|
||||||
|
accountId: ACCOUNT_ID,
|
||||||
|
authDir,
|
||||||
|
onMessage,
|
||||||
|
});
|
||||||
const sock = await createWaSocket();
|
const sock = await createWaSocket();
|
||||||
|
|
||||||
const upsert = {
|
const upsert = {
|
||||||
@ -168,7 +173,12 @@ describe("web monitor inbox", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onMessage = vi.fn();
|
const onMessage = vi.fn();
|
||||||
const listener = await monitorWebInbox({ verbose: false, accountId: ACCOUNT_ID, authDir, onMessage });
|
const listener = await monitorWebInbox({
|
||||||
|
verbose: false,
|
||||||
|
accountId: ACCOUNT_ID,
|
||||||
|
authDir,
|
||||||
|
onMessage,
|
||||||
|
});
|
||||||
const sock = await createWaSocket();
|
const sock = await createWaSocket();
|
||||||
|
|
||||||
// Message from self (sock.user.id is "123@s.whatsapp.net" in mock)
|
// Message from self (sock.user.id is "123@s.whatsapp.net" in mock)
|
||||||
@ -211,7 +221,12 @@ describe("web monitor inbox", () => {
|
|||||||
.mockResolvedValueOnce({ code: "PAIRCODE", created: false });
|
.mockResolvedValueOnce({ code: "PAIRCODE", created: false });
|
||||||
|
|
||||||
const onMessage = vi.fn();
|
const onMessage = vi.fn();
|
||||||
const listener = await monitorWebInbox({ verbose: false, accountId: ACCOUNT_ID, authDir, onMessage });
|
const listener = await monitorWebInbox({
|
||||||
|
verbose: false,
|
||||||
|
accountId: ACCOUNT_ID,
|
||||||
|
authDir,
|
||||||
|
onMessage,
|
||||||
|
});
|
||||||
const sock = await createWaSocket();
|
const sock = await createWaSocket();
|
||||||
|
|
||||||
// Message from someone else should be blocked
|
// Message from someone else should be blocked
|
||||||
@ -316,7 +331,12 @@ describe("web monitor inbox", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onMessage = vi.fn();
|
const onMessage = vi.fn();
|
||||||
const listener = await monitorWebInbox({ verbose: false, accountId: ACCOUNT_ID, authDir, onMessage });
|
const listener = await monitorWebInbox({
|
||||||
|
verbose: false,
|
||||||
|
accountId: ACCOUNT_ID,
|
||||||
|
authDir,
|
||||||
|
onMessage,
|
||||||
|
});
|
||||||
const sock = await createWaSocket();
|
const sock = await createWaSocket();
|
||||||
|
|
||||||
const upsert = {
|
const upsert = {
|
||||||
@ -367,7 +387,12 @@ describe("web monitor inbox", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onMessage = vi.fn();
|
const onMessage = vi.fn();
|
||||||
const listener = await monitorWebInbox({ verbose: false, accountId: ACCOUNT_ID, authDir, onMessage });
|
const listener = await monitorWebInbox({
|
||||||
|
verbose: false,
|
||||||
|
accountId: ACCOUNT_ID,
|
||||||
|
authDir,
|
||||||
|
onMessage,
|
||||||
|
});
|
||||||
const sock = await createWaSocket();
|
const sock = await createWaSocket();
|
||||||
|
|
||||||
const upsert = {
|
const upsert = {
|
||||||
@ -405,7 +430,12 @@ describe("web monitor inbox", () => {
|
|||||||
|
|
||||||
it("handles append messages by marking them read but skipping auto-reply", async () => {
|
it("handles append messages by marking them read but skipping auto-reply", async () => {
|
||||||
const onMessage = vi.fn();
|
const onMessage = vi.fn();
|
||||||
const listener = await monitorWebInbox({ verbose: false, accountId: ACCOUNT_ID, authDir, onMessage });
|
const listener = await monitorWebInbox({
|
||||||
|
verbose: false,
|
||||||
|
accountId: ACCOUNT_ID,
|
||||||
|
authDir,
|
||||||
|
onMessage,
|
||||||
|
});
|
||||||
const sock = await createWaSocket();
|
const sock = await createWaSocket();
|
||||||
|
|
||||||
const upsert = {
|
const upsert = {
|
||||||
|
|||||||
@ -115,7 +115,12 @@ describe("web monitor inbox", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onMessage = vi.fn();
|
const onMessage = vi.fn();
|
||||||
const listener = await monitorWebInbox({ verbose: false, accountId: _ACCOUNT_ID, authDir, onMessage });
|
const listener = await monitorWebInbox({
|
||||||
|
verbose: false,
|
||||||
|
accountId: _ACCOUNT_ID,
|
||||||
|
authDir,
|
||||||
|
onMessage,
|
||||||
|
});
|
||||||
const sock = await createWaSocket();
|
const sock = await createWaSocket();
|
||||||
|
|
||||||
// Message from unauthorized sender +999 (not in allowFrom)
|
// Message from unauthorized sender +999 (not in allowFrom)
|
||||||
@ -176,7 +181,12 @@ describe("web monitor inbox", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onMessage = vi.fn();
|
const onMessage = vi.fn();
|
||||||
const listener = await monitorWebInbox({ verbose: false, accountId: _ACCOUNT_ID, authDir, onMessage });
|
const listener = await monitorWebInbox({
|
||||||
|
verbose: false,
|
||||||
|
accountId: _ACCOUNT_ID,
|
||||||
|
authDir,
|
||||||
|
onMessage,
|
||||||
|
});
|
||||||
const sock = await createWaSocket();
|
const sock = await createWaSocket();
|
||||||
|
|
||||||
const upsert = {
|
const upsert = {
|
||||||
@ -252,7 +262,12 @@ describe("web monitor inbox", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onMessage = vi.fn();
|
const onMessage = vi.fn();
|
||||||
const listener = await monitorWebInbox({ verbose: false, accountId: _ACCOUNT_ID, authDir, onMessage });
|
const listener = await monitorWebInbox({
|
||||||
|
verbose: false,
|
||||||
|
accountId: _ACCOUNT_ID,
|
||||||
|
authDir,
|
||||||
|
onMessage,
|
||||||
|
});
|
||||||
const sock = await createWaSocket();
|
const sock = await createWaSocket();
|
||||||
|
|
||||||
const upsert = {
|
const upsert = {
|
||||||
@ -293,7 +308,12 @@ describe("web monitor inbox", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onMessage = vi.fn();
|
const onMessage = vi.fn();
|
||||||
const listener = await monitorWebInbox({ verbose: false, accountId: _ACCOUNT_ID, authDir, onMessage });
|
const listener = await monitorWebInbox({
|
||||||
|
verbose: false,
|
||||||
|
accountId: _ACCOUNT_ID,
|
||||||
|
authDir,
|
||||||
|
onMessage,
|
||||||
|
});
|
||||||
const sock = await createWaSocket();
|
const sock = await createWaSocket();
|
||||||
|
|
||||||
const upsert = {
|
const upsert = {
|
||||||
@ -337,7 +357,12 @@ describe("web monitor inbox", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onMessage = vi.fn();
|
const onMessage = vi.fn();
|
||||||
const listener = await monitorWebInbox({ verbose: false, accountId: _ACCOUNT_ID, authDir, onMessage });
|
const listener = await monitorWebInbox({
|
||||||
|
verbose: false,
|
||||||
|
accountId: _ACCOUNT_ID,
|
||||||
|
authDir,
|
||||||
|
onMessage,
|
||||||
|
});
|
||||||
const sock = await createWaSocket();
|
const sock = await createWaSocket();
|
||||||
|
|
||||||
const upsert = {
|
const upsert = {
|
||||||
@ -381,7 +406,12 @@ describe("web monitor inbox", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onMessage = vi.fn();
|
const onMessage = vi.fn();
|
||||||
const listener = await monitorWebInbox({ verbose: false, accountId: _ACCOUNT_ID, authDir, onMessage });
|
const listener = await monitorWebInbox({
|
||||||
|
verbose: false,
|
||||||
|
accountId: _ACCOUNT_ID,
|
||||||
|
authDir,
|
||||||
|
onMessage,
|
||||||
|
});
|
||||||
const sock = await createWaSocket();
|
const sock = await createWaSocket();
|
||||||
|
|
||||||
const upsert = {
|
const upsert = {
|
||||||
@ -428,7 +458,12 @@ describe("web monitor inbox", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onMessage = vi.fn();
|
const onMessage = vi.fn();
|
||||||
const listener = await monitorWebInbox({ verbose: false, accountId: _ACCOUNT_ID, authDir, onMessage });
|
const listener = await monitorWebInbox({
|
||||||
|
verbose: false,
|
||||||
|
accountId: _ACCOUNT_ID,
|
||||||
|
authDir,
|
||||||
|
onMessage,
|
||||||
|
});
|
||||||
const sock = await createWaSocket();
|
const sock = await createWaSocket();
|
||||||
|
|
||||||
const upsert = {
|
const upsert = {
|
||||||
@ -473,7 +508,12 @@ describe("web monitor inbox", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onMessage = vi.fn();
|
const onMessage = vi.fn();
|
||||||
const listener = await monitorWebInbox({ verbose: false, accountId: _ACCOUNT_ID, authDir, onMessage });
|
const listener = await monitorWebInbox({
|
||||||
|
verbose: false,
|
||||||
|
accountId: _ACCOUNT_ID,
|
||||||
|
authDir,
|
||||||
|
onMessage,
|
||||||
|
});
|
||||||
const sock = await createWaSocket();
|
const sock = await createWaSocket();
|
||||||
|
|
||||||
const upsert = {
|
const upsert = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user