chore: format web monitor inbox tests
This commit is contained in:
@@ -113,7 +113,12 @@ describe("web monitor inbox", () => {
|
||||
});
|
||||
|
||||
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 upsert = {
|
||||
@@ -168,7 +173,12 @@ describe("web monitor inbox", () => {
|
||||
});
|
||||
|
||||
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();
|
||||
|
||||
// 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 });
|
||||
|
||||
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();
|
||||
|
||||
// Message from someone else should be blocked
|
||||
@@ -316,7 +331,12 @@ describe("web monitor inbox", () => {
|
||||
});
|
||||
|
||||
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 upsert = {
|
||||
@@ -367,7 +387,12 @@ describe("web monitor inbox", () => {
|
||||
});
|
||||
|
||||
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 upsert = {
|
||||
@@ -405,7 +430,12 @@ describe("web monitor inbox", () => {
|
||||
|
||||
it("handles append messages by marking them read but skipping auto-reply", async () => {
|
||||
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 upsert = {
|
||||
|
||||
@@ -115,7 +115,12 @@ describe("web monitor inbox", () => {
|
||||
});
|
||||
|
||||
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();
|
||||
|
||||
// Message from unauthorized sender +999 (not in allowFrom)
|
||||
@@ -176,7 +181,12 @@ describe("web monitor inbox", () => {
|
||||
});
|
||||
|
||||
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 upsert = {
|
||||
@@ -252,7 +262,12 @@ describe("web monitor inbox", () => {
|
||||
});
|
||||
|
||||
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 upsert = {
|
||||
@@ -293,7 +308,12 @@ describe("web monitor inbox", () => {
|
||||
});
|
||||
|
||||
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 upsert = {
|
||||
@@ -337,7 +357,12 @@ describe("web monitor inbox", () => {
|
||||
});
|
||||
|
||||
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 upsert = {
|
||||
@@ -381,7 +406,12 @@ describe("web monitor inbox", () => {
|
||||
});
|
||||
|
||||
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 upsert = {
|
||||
@@ -428,7 +458,12 @@ describe("web monitor inbox", () => {
|
||||
});
|
||||
|
||||
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 upsert = {
|
||||
@@ -473,7 +508,12 @@ describe("web monitor inbox", () => {
|
||||
});
|
||||
|
||||
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 upsert = {
|
||||
|
||||
Reference in New Issue
Block a user