refactor: use shared pairing store for telegram

This commit is contained in:
Ayaan Zaidi
2026-02-01 14:55:41 +05:30
committed by Ayaan Zaidi
parent ca92597e1f
commit 24fbafa9a7
23 changed files with 95 additions and 288 deletions

View File

@@ -34,17 +34,17 @@ vi.mock("../config/sessions.js", async (importOriginal) => {
};
});
const { readTelegramAllowFromStore, upsertTelegramPairingRequest } = vi.hoisted(() => ({
readTelegramAllowFromStore: vi.fn(async () => [] as string[]),
upsertTelegramPairingRequest: vi.fn(async () => ({
const { readChannelAllowFromStore, upsertChannelPairingRequest } = vi.hoisted(() => ({
readChannelAllowFromStore: vi.fn(async () => [] as string[]),
upsertChannelPairingRequest: vi.fn(async () => ({
code: "PAIRCODE",
created: true,
})),
}));
vi.mock("./pairing-store.js", () => ({
readTelegramAllowFromStore,
upsertTelegramPairingRequest,
vi.mock("../pairing/pairing-store.js", () => ({
readChannelAllowFromStore,
upsertChannelPairingRequest,
}));
const useSpy = vi.fn();