Gate bot logic on full account authentication

This commit is contained in:
jjbrunton committed 2026-08-08 16:01:06 +01:00
1 parent 4db6de8bf5
commit 2fd92bf82c
22 files changed
+635 -65

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import { describe, expect, it, vi } from 'vitest';
import { ResponseCheckerService } from '../src/services/response-checker.js';
import { createMockLogger } from './mockLogger.js';
describe('ResponseCheckerService account authentication gate', () => {
it('does not query repositories or navigate while unauthenticated', async () => {
const page = { goto: vi.fn() };
const messages = { getUncheckedMessages: vi.fn() };
const auth = { isFullyAuthenticated: vi.fn(() => false) };
const checker = new ResponseCheckerService(
page as never,
messages as never,
{} as never,
{} as never,
createMockLogger(),
auth,
);
await expect(checker.checkForResponses()).resolves.toEqual([]);
expect(messages.getUncheckedMessages).not.toHaveBeenCalled();
expect(page.goto).not.toHaveBeenCalled();
});
});