Files
HexaHost-GameCloud/apps/api/test/whmcs-phase-d.test.js
smueller 333ad1cc7d
Some checks failed
CI / Node — lint, typecheck, test, build (push) Failing after 9s
CI / Go — node-agent tests (push) Failing after 8s
CI / Go — edge-gateway build (push) Successful in 17s
Phase D
2026-06-26 14:03:57 +02:00

43 lines
1.3 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 d sso contract', () => {
it('documents SSO create and consume routes', () => {
const whmcsSource = readFileSync(
join(process.cwd(), 'src', 'integrations/whmcs/whmcs-integration.controller.ts'),
'utf8',
);
assert.ok(whmcsSource.includes("'services/:externalServiceId/sso'"));
const authSource = readFileSync(
join(process.cwd(), 'src', 'auth/auth.controller.ts'),
'utf8',
);
assert.ok(authSource.includes("'sso/consume'"));
const ssoServiceSource = readFileSync(
join(process.cwd(), 'src', 'auth/sso.service.ts'),
'utf8',
);
assert.ok(ssoServiceSource.includes('createWhmcsServiceSso'));
assert.ok(ssoServiceSource.includes('consumeTicket'));
assert.ok(ssoServiceSource.includes('isImpersonation'));
});
it('documents WHMCS PHP SSO hooks', () => {
const phpSource = readFileSync(
join(
process.cwd(),
'..',
'..',
'integrations/whmcs/modules/servers/hexagamecloud/hexagamecloud.php',
),
'utf8',
);
assert.ok(phpSource.includes('ServiceSingleSignOn'));
assert.ok(phpSource.includes('AdminSingleSignOn'));
});
});