Launch agent: disable autostart without killing running app

This commit is contained in:
Peter Steinberger
2025-12-07 19:01:01 +01:00
parent 8a8ac1ffe6
commit d73d571f19
10 changed files with 1821 additions and 1761 deletions

View File

@@ -9,6 +9,16 @@ vi.mock("../web/ipc.js", () => ({
sendViaIpc: (...args: unknown[]) => sendViaIpcMock(...args),
}));
const originalTelegramToken = process.env.TELEGRAM_BOT_TOKEN;
beforeEach(() => {
process.env.TELEGRAM_BOT_TOKEN = "token-abc";
});
afterAll(() => {
process.env.TELEGRAM_BOT_TOKEN = originalTelegramToken;
});
const runtime: RuntimeEnv = {
log: vi.fn(),
error: vi.fn(),
@@ -86,7 +96,7 @@ describe("sendCommand", () => {
expect(deps.sendMessageTelegram).toHaveBeenCalledWith(
"123",
"hi",
expect.objectContaining({ token: expect.any(String) }),
expect.objectContaining({ token: "token-abc" }),
);
expect(deps.sendMessageWhatsApp).not.toHaveBeenCalled();
});