// AUTO-GENERATED FILE - DO NOT EDIT // This file was automatically generated by the XDK build tool. // Any manual changes will be overwritten on the next generation. /** * AUTO-GENERATED FILE - DO NOT EDIT * This file was automatically generated by the XDK build tool. * Any manual changes will be overwritten on the next generation. * * Auto-generated structural tests for Compliance client. * * This module contains tests that validate the structure and API surface * of the Compliance client. These tests ensure that all expected methods * exist, have correct signatures, and proper type annotations for robust API contracts. * * Generated automatically - do not edit manually. */ import { describe, it, expect, beforeAll } from '@jest/globals'; import { ComplianceClient } from '../../src/compliance/client.js'; import { Client } from '../../src/client.js'; describe('ComplianceClient Structure', () => { let client: Client; let complianceClient: ComplianceClient; beforeAll(() => { client = new Client({ baseUrl: 'https://api.example.com' }); complianceClient = client.compliance; }); it('should have downloadJobResults method with correct signature', () => { // Check method exists expect(ComplianceClient.prototype).toHaveProperty('downloadJobResults'); // Check method is callable const method = complianceClient.downloadJobResults; expect(typeof method).toBe('function'); // Check method signature by examining parameter count const methodString = method.toString(); const paramsMatch = methodString.match(/\(([^)]*)\)/); const params = paramsMatch ? paramsMatch[1].split(',').map(p => p.trim().split(':')[0].trim()).filter(p => p) : []; // Check required parameters exist (convert to camelCase for TypeScript) const requiredParams = [ 'id', 'token', ]; for (const requiredParam of requiredParams) { // Check if parameter exists (may be in camelCase or snake_case) const paramExists = params.some(p => p === requiredParam || p.toLowerCase() === requiredParam.toLowerCase() || p.replace(/_/g, '') === requiredParam.replace(/_/g, '') ); expect(paramExists).toBe(true); } }); it('should have downloadJobResults method with return type annotation', () => { const method = complianceClient.downloadJobResults; expect(typeof method).toBe('function'); // TypeScript will enforce return types at compile time // This test ensures the method exists and is callable }); it('should have getJobs method with correct signature', () => { // Check method exists expect(ComplianceClient.prototype).toHaveProperty('getJobs'); // Check method is callable const method = complianceClient.getJobs; expect(typeof method).toBe('function'); // Check method signature by examining parameter count const methodString = method.toString(); const paramsMatch = methodString.match(/\(([^)]*)\)/); const params = paramsMatch ? paramsMatch[1].split(',').map(p => p.trim().split(':')[0].trim()).filter(p => p) : []; // Check required parameters exist (convert to camelCase for TypeScript) const requiredParams = [ 'type', ]; for (const requiredParam of requiredParams) { // Check if parameter exists (may be in camelCase or snake_case) const paramExists = params.some(p => p === requiredParam || p.toLowerCase() === requiredParam.toLowerCase() || p.replace(/_/g, '') === requiredParam.replace(/_/g, '') ); expect(paramExists).toBe(true); } }); it('should have getJobs method with return type annotation', () => { const method = complianceClient.getJobs; expect(typeof method).toBe('function'); // TypeScript will enforce return types at compile time // This test ensures the method exists and is callable }); it('should have createJobs method with correct signature', () => { // Check method exists expect(ComplianceClient.prototype).toHaveProperty('createJobs'); // Check method is callable const method = complianceClient.createJobs; expect(typeof method).toBe('function'); // Check method signature by examining parameter count const methodString = method.toString(); const paramsMatch = methodString.match(/\(([^)]*)\)/); const params = paramsMatch ? paramsMatch[1].split(',').map(p => p.trim().split(':')[0].trim()).filter(p => p) : []; // Check required parameters exist (convert to camelCase for TypeScript) const requiredParams = [ ]; for (const requiredParam of requiredParams) { // Check if parameter exists (may be in camelCase or snake_case) const paramExists = params.some(p => p === requiredParam || p.toLowerCase() === requiredParam.toLowerCase() || p.replace(/_/g, '') === requiredParam.replace(/_/g, '') ); expect(paramExists).toBe(true); } }); it('should have createJobs method with return type annotation', () => { const method = complianceClient.createJobs; expect(typeof method).toBe('function'); // TypeScript will enforce return types at compile time // This test ensures the method exists and is callable }); it('should have getJobsById method with correct signature', () => { // Check method exists expect(ComplianceClient.prototype).toHaveProperty('getJobsById'); // Check method is callable const method = complianceClient.getJobsById; expect(typeof method).toBe('function'); // Check method signature by examining parameter count const methodString = method.toString(); const paramsMatch = methodString.match(/\(([^)]*)\)/); const params = paramsMatch ? paramsMatch[1].split(',').map(p => p.trim().split(':')[0].trim()).filter(p => p) : []; // Check required parameters exist (convert to camelCase for TypeScript) const requiredParams = [ 'id', ]; for (const requiredParam of requiredParams) { // Check if parameter exists (may be in camelCase or snake_case) const paramExists = params.some(p => p === requiredParam || p.toLowerCase() === requiredParam.toLowerCase() || p.replace(/_/g, '') === requiredParam.replace(/_/g, '') ); expect(paramExists).toBe(true); } }); it('should have getJobsById method with return type annotation', () => { const method = complianceClient.getJobsById; expect(typeof method).toBe('function'); // TypeScript will enforce return types at compile time // This test ensures the method exists and is callable }); it('should have deleteJobsById method with correct signature', () => { // Check method exists expect(ComplianceClient.prototype).toHaveProperty('deleteJobsById'); // Check method is callable const method = complianceClient.deleteJobsById; expect(typeof method).toBe('function'); // Check method signature by examining parameter count const methodString = method.toString(); const paramsMatch = methodString.match(/\(([^)]*)\)/); const params = paramsMatch ? paramsMatch[1].split(',').map(p => p.trim().split(':')[0].trim()).filter(p => p) : []; // Check required parameters exist (convert to camelCase for TypeScript) const requiredParams = [ 'id', ]; for (const requiredParam of requiredParams) { // Check if parameter exists (may be in camelCase or snake_case) const paramExists = params.some(p => p === requiredParam || p.toLowerCase() === requiredParam.toLowerCase() || p.replace(/_/g, '') === requiredParam.replace(/_/g, '') ); expect(paramExists).toBe(true); } }); it('should have deleteJobsById method with return type annotation', () => { const method = complianceClient.deleteJobsById; expect(typeof method).toBe('function'); // TypeScript will enforce return types at compile time // This test ensures the method exists and is callable }); it('should have uploadJobSubmission method with correct signature', () => { // Check method exists expect(ComplianceClient.prototype).toHaveProperty('uploadJobSubmission'); // Check method is callable const method = complianceClient.uploadJobSubmission; expect(typeof method).toBe('function'); // Check method signature by examining parameter count const methodString = method.toString(); const paramsMatch = methodString.match(/\(([^)]*)\)/); const params = paramsMatch ? paramsMatch[1].split(',').map(p => p.trim().split(':')[0].trim()).filter(p => p) : []; // Check required parameters exist (convert to camelCase for TypeScript) const requiredParams = [ 'id', 'token', ]; for (const requiredParam of requiredParams) { // Check if parameter exists (may be in camelCase or snake_case) const paramExists = params.some(p => p === requiredParam || p.toLowerCase() === requiredParam.toLowerCase() || p.replace(/_/g, '') === requiredParam.replace(/_/g, '') ); expect(paramExists).toBe(true); } }); it('should have uploadJobSubmission method with return type annotation', () => { const method = complianceClient.uploadJobSubmission; expect(typeof method).toBe('function'); // TypeScript will enforce return types at compile time // This test ensures the method exists and is callable }); it('should have all expected methods', () => { const expectedMethods = [ 'downloadJobResults', 'getJobs', 'createJobs', 'getJobsById', 'deleteJobsById', 'uploadJobSubmission', ]; for (const expectedMethod of expectedMethods) { expect(ComplianceClient.prototype).toHaveProperty(expectedMethod); const method = (complianceClient as any)[expectedMethod]; expect(typeof method).toBe('function'); } }); });