Enable automatic browsing upvotes
This commit is contained in:
1 parent
27012399ec
commit
7bf1aa9d24
26 files changed
+339
-57
No files matched your search
@@ -68,7 +68,7 @@ describe('AccountRuntimeLoop mode gating', () => {
|
||||
...(growthService ? { growthService } : {}),
|
||||
...(browsingService ? { browsingService } : {}),
|
||||
};
|
||||
const config = { reddit: { pollIntervalMs: 1_000 } };
|
||||
const config = { reddit: { pollIntervalMs: 1_000 }, browser: { dryRun: false } };
|
||||
const logger = { info: vi.fn(), warn: vi.fn(), error: vi.fn(), debug: vi.fn() };
|
||||
const loop = new AccountRuntimeLoop(
|
||||
resources as never, config as never, logger as never, getBotMode, { } as never,
|
||||
@@ -82,7 +82,7 @@ describe('AccountRuntimeLoop mode gating', () => {
|
||||
/** Lets the loop complete at least one full pass before we assert. */
|
||||
async function runBriefly(loop: AccountRuntimeLoop): Promise<void> {
|
||||
loop.start();
|
||||
await new Promise((resolve) => setTimeout(resolve, 30));
|
||||
await new Promise((resolve) => setTimeout(resolve, 60));
|
||||
await loop.stop();
|
||||
}
|
||||
|
||||
@@ -220,7 +220,9 @@ describe('AccountRuntimeLoop mode gating', () => {
|
||||
|
||||
await runBriefly(fixture.loop);
|
||||
|
||||
expect(browsing.tick).toHaveBeenCalledWith(expect.anything());
|
||||
expect(browsing.tick).toHaveBeenCalledWith(
|
||||
{ allowVoting: mode === 'running' }, expect.anything(),
|
||||
);
|
||||
expect(growth.tick.mock.invocationCallOrder[0])
|
||||
.toBeLessThan(browsing.tick.mock.invocationCallOrder[0]);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user