refactor(core): Extract ActiveWebhooks out of ActiveWorkflowRunner (no-changelog) (#8171)

## Summary
This PR continues refactoring webhooks code for better modularity.
Continued from #8069 to bring back `ActiveWebhooks`, but this time
actually handling active webhook calls in this class.

## Review / Merge checklist
- [x] PR title and summary are descriptive
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-12-28 10:04:32 +01:00
committed by GitHub
parent 68cff4c59e
commit c84d3c3bbf
4 changed files with 170 additions and 159 deletions

View File

@@ -4,7 +4,7 @@ import { mock } from 'jest-mock-extended';
import config from '@/config';
import { AbstractServer } from '@/AbstractServer';
import { ActiveWorkflowRunner } from '@/ActiveWorkflowRunner';
import { ActiveWebhooks } from '@/ActiveWebhooks';
import { ExternalHooks } from '@/ExternalHooks';
import { InternalHooks } from '@/InternalHooks';
import { TestWebhooks } from '@/TestWebhooks';
@@ -22,7 +22,7 @@ describe('WebhookServer', () => {
describe('CORS', () => {
const corsOrigin = 'https://example.com';
const activeWorkflowRunner = mockInstance(ActiveWorkflowRunner);
const activeWebhooks = mockInstance(ActiveWebhooks);
const testWebhooks = mockInstance(TestWebhooks);
mockInstance(WaitingWebhooks);
mockInstance(WaitingForms);
@@ -36,7 +36,7 @@ describe('WebhookServer', () => {
});
const tests = [
['webhook', activeWorkflowRunner],
['webhook', activeWebhooks],
['webhookTest', testWebhooks],
// TODO: enable webhookWaiting & waitingForms after CORS support is added
// ['webhookWaiting', waitingWebhooks],