Merge pull request #2497 from PR0M3TH3AN/agents/daily/ci-health-agent-2026-02-14-5523154352363649208

chore(ai): CI health fixes (flaky tests)
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-02-14 09:56:53 -05:00
commit a07f197773
3 files changed
+63 -34

No files matched your search

+8 -6
View File
@@ -127,14 +127,16 @@ test("EngagementController", async (t) => {
const eventId = "test-event-id";
mockNostrClient.rebroadcastEvent.mock.mockImplementation(async () => ({ throttled: true, cooldown: { remainingMs: 5000 } }));
global.window = { setTimeout: t.mock.fn() };
try {
global.window = { setTimeout: t.mock.fn() };
await controller.handleEnsurePresenceAction({ eventId });
await controller.handleEnsurePresenceAction({ eventId });
assert.equal(mockShowStatus.mock.calls.length, 1);
assert.match(mockShowStatus.mock.calls[0].arguments[0], /Rebroadcast is cooling down/);
delete global.window;
assert.equal(mockShowStatus.mock.calls.length, 1);
assert.match(mockShowStatus.mock.calls[0].arguments[0], /Rebroadcast is cooling down/);
} finally {
delete global.window;
}
});
await t.test("handleEnsurePresenceAction - should show success on successful rebroadcast", async () => {