chore: fix linting issues in ack-reaction feature
- Remove unused mock variables in tests - Remove unused ackReactionScope variables in simple test cases - Fix line length for ackReactionScope declaration - All lint checks passing (0 warnings, 0 errors) - All tests passing (8/8)
This commit is contained in:
committed by
Peter Steinberger
parent
c3587d6cae
commit
d38b232724
@@ -2,12 +2,6 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
|
|||||||
import type { ClawdbotConfig } from "../config/types.js";
|
import type { ClawdbotConfig } from "../config/types.js";
|
||||||
|
|
||||||
describe("WhatsApp ack reaction", () => {
|
describe("WhatsApp ack reaction", () => {
|
||||||
const mockSendReaction = vi.fn(async () => {});
|
|
||||||
const mockGetReply = vi.fn(async () => ({
|
|
||||||
payloads: [{ text: "test reply" }],
|
|
||||||
meta: {},
|
|
||||||
}));
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
vi.clearAllMocks();
|
vi.clearAllMocks();
|
||||||
});
|
});
|
||||||
@@ -265,7 +259,6 @@ describe("WhatsApp ack reaction", () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const ackReaction = (cfg.messages?.ackReaction ?? "").trim();
|
const ackReaction = (cfg.messages?.ackReaction ?? "").trim();
|
||||||
const ackReactionScope = cfg.messages?.ackReactionScope ?? "group-mentions";
|
|
||||||
const didSendReply = false; // No reply sent
|
const didSendReply = false; // No reply sent
|
||||||
|
|
||||||
const shouldAckReaction = () => {
|
const shouldAckReaction = () => {
|
||||||
@@ -296,7 +289,6 @@ describe("WhatsApp ack reaction", () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const ackReaction = (cfg.messages?.ackReaction ?? "").trim();
|
const ackReaction = (cfg.messages?.ackReaction ?? "").trim();
|
||||||
const ackReactionScope = cfg.messages?.ackReactionScope ?? "group-mentions";
|
|
||||||
const didSendReply = true;
|
const didSendReply = true;
|
||||||
|
|
||||||
const shouldAckReaction = () => {
|
const shouldAckReaction = () => {
|
||||||
|
|||||||
@@ -1389,7 +1389,8 @@ export async function monitorWebProvider(
|
|||||||
|
|
||||||
// Send ack reaction after successful reply
|
// Send ack reaction after successful reply
|
||||||
const ackReaction = (cfg.messages?.ackReaction ?? "").trim();
|
const ackReaction = (cfg.messages?.ackReaction ?? "").trim();
|
||||||
const ackReactionScope = cfg.messages?.ackReactionScope ?? "group-mentions";
|
const ackReactionScope =
|
||||||
|
cfg.messages?.ackReactionScope ?? "group-mentions";
|
||||||
const shouldAckReaction = () => {
|
const shouldAckReaction = () => {
|
||||||
if (!ackReaction) return false;
|
if (!ackReaction) return false;
|
||||||
if (!msg.id) return false;
|
if (!msg.id) return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user