Files
HexaHost-GameCloud/apps/api/test/whmcs-phase-ef.test.js
smueller 15cf302afc
Some checks failed
CI / Node — lint, typecheck, test, build (push) Failing after 10s
CI / Go — node-agent tests (push) Failing after 8s
CI / Go — edge-gateway build (push) Successful in 18s
Phase F
2026-06-26 15:05:01 +02:00

47 lines
1.9 KiB
JavaScript

import { describe, it } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
describe('whmcs phase e/f contract', () => {
it('documents reconciliation, events and usage routes', () => {
const whmcsSource = readFileSync(
join(process.cwd(), 'src', 'integrations/whmcs/whmcs-integration.controller.ts'),
'utf8',
);
assert.ok(whmcsSource.includes("'accounts'"));
assert.ok(whmcsSource.includes("'services/import'"));
assert.ok(whmcsSource.includes("'reconcile'"));
assert.ok(whmcsSource.includes("'services/:externalServiceId/reconcile'"));
assert.ok(whmcsSource.includes("'events'"));
assert.ok(whmcsSource.includes("'events/ack'"));
assert.ok(whmcsSource.includes("'services/:externalServiceId/usage'"));
assert.ok(whmcsSource.includes("'services/:externalServiceId/usage/adjustments'"));
const reconcileSource = readFileSync(
join(process.cwd(), 'src', 'integrations/whmcs/whmcs-reconciliation.service.ts'),
'utf8',
);
assert.ok(reconcileSource.includes('listAccounts'));
assert.ok(reconcileSource.includes('importService'));
assert.ok(reconcileSource.includes('reconcileInstallation'));
const usageSource = readFileSync(
join(process.cwd(), 'src', 'integrations/whmcs/whmcs-usage.service.ts'),
'utf8',
);
assert.ok(usageSource.includes('runtime_minutes'));
assert.ok(usageSource.includes('createAdjustment'));
});
it('documents WHMCS PHP ListAccounts and usage hooks', () => {
const phpSource = readFileSync(
join(process.cwd(), '..', '..', 'integrations/whmcs/modules/servers/hexagamecloud/hexagamecloud.php'),
'utf8',
);
assert.ok(phpSource.includes('hexagamecloud_ListAccounts'));
assert.ok(phpSource.includes('hexagamecloud_MetricProvider'));
assert.ok(phpSource.includes('hexagamecloud_UsageUpdate'));
});
});