cloud-classify-client.test.ts 872 B

123456789101112131415161718192021222324252627282930
  1. import { afterEach, describe, expect, it } from 'vitest';
  2. import { getPermissionCheckApiUrl } from '../../../src/classifier/cloud-classify-client.js';
  3. import {
  4. configurePermissionHost,
  5. resetPermissionHostForTesting,
  6. } from '../../../src/host-utils.js';
  7. describe('getPermissionCheckApiUrl', () => {
  8. afterEach(() => {
  9. resetPermissionHostForTesting();
  10. });
  11. it('uses the China production domain for Desktop permission checks', () => {
  12. configurePermissionHost({
  13. runtimeConfigProvider: {
  14. getConfig: () => {
  15. throw new Error('not needed by endpoint resolution');
  16. },
  17. getRuntimeRegion: () => 'cn',
  18. getRuntimeBuildEnv: () => 'prod',
  19. isManagedRuntime: () => true,
  20. },
  21. });
  22. expect(getPermissionCheckApiUrl()).toBe(
  23. 'https://agent.minimax.cn/mavis/api/v1/permission/check',
  24. );
  25. });
  26. });