CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
systemInfoFields.test.ts86 linesDownload Raw Back to utils
1/**2 * @license3 * Copyright 2025 Qwen4 * SPDX-License-Identifier: Apache-2.05 */6 7import { describe, expect, it } from 'vitest';8import { getSystemInfoFields } from './systemInfoFields.js';9import type { ExtendedSystemInfo } from './systemInfo.js';10 11describe('getAboutSystemInfoFields', () => {12  it('orders sandbox/proxy after session id', () => {13    const info: ExtendedSystemInfo = {14      cliVersion: '1.0.0',15      osPlatform: 'darwin',16      osArch: 'arm64',17      osRelease: '23.0.0',18      nodeVersion: 'v20.0.0',19      npmVersion: '10.0.0',20      sandboxEnv: 'no sandbox',21      modelVersion: 'test-model',22      selectedAuthType: 'test-auth',23      ideClient: 'test-ide',24      lspStatus: 'enabled, 1/1 ready',25      sessionId: 'test-session-id',26      memoryUsage: '100 MB',27      baseUrl: undefined,28      gitCommit: undefined,29      proxy: 'http://user:pass@localhost:7890',30    };31 32    const fields = getSystemInfoFields(info);33    const labels = fields.map((f) => f.label);34 35    expect(labels).toEqual([36      'Qwen Code',37      'Runtime',38      'IDE Client',39      'LSP',40      'OS',41      'Auth',42      'Model',43      'Fast Model',44      'Session ID',45      'Sandbox',46      'Proxy',47      'Memory Usage',48    ]);49 50    expect(labels.indexOf('Session ID')).toBeLessThan(51      labels.indexOf('Sandbox'),52    );53    expect(labels.indexOf('Session ID')).toBeLessThan(labels.indexOf('Proxy'));54 55    const lspField = fields.find((f) => f.label === 'LSP');56    expect(lspField?.value).toBe('enabled, 1/1 ready');57 58    const proxyField = fields.find((f) => f.label === 'Proxy');59    expect(proxyField?.value).toBe('http://***:***@localhost:7890/');60  });61 62  it('always includes Proxy with "no proxy" when unset', () => {63    const info: ExtendedSystemInfo = {64      cliVersion: '1.0.0',65      osPlatform: 'darwin',66      osArch: 'arm64',67      osRelease: '23.0.0',68      nodeVersion: 'v20.0.0',69      npmVersion: '10.0.0',70      sandboxEnv: 'no sandbox',71      modelVersion: 'test-model',72      selectedAuthType: 'test-auth',73      ideClient: 'test-ide',74      sessionId: 'test-session-id',75      memoryUsage: '100 MB',76      baseUrl: undefined,77      gitCommit: undefined,78      proxy: undefined,79    };80 81    const fields = getSystemInfoFields(info);82    const proxyField = fields.find((f) => f.label === 'Proxy');83    expect(proxyField?.value).toBe('no proxy');84  });85});86 
basant307/AI_Governance_Project · CoolFace