feat(agents): 新增云端智能体入口与草稿编辑
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { getGuardedAiModuleForPath, isAiModuleAllowed, isProgrammingProviderRoute } from '@/lib/ai-modules';
|
||||
import {
|
||||
DEFAULT_MODULE_ACCESS,
|
||||
MODULE_ACCESS_KEYS,
|
||||
@@ -6,12 +7,19 @@ import {
|
||||
} from '../../shared/module-access';
|
||||
|
||||
describe('module access projection', () => {
|
||||
it('contains only the three supported product modules', () => {
|
||||
expect(MODULE_ACCESS_KEYS).toEqual(['programming', 'design', 'robot']);
|
||||
it('honors an explicit cloud Agent denial and does not initialize Code for its route', () => {
|
||||
const access = normalizeModuleAccess({ cloud_agents: false });
|
||||
expect(isAiModuleAllowed('cloud_agents', access)).toBe(false);
|
||||
expect(getGuardedAiModuleForPath('/cloud-agents')).toBe('cloud_agents');
|
||||
expect(isProgrammingProviderRoute('/cloud-agents')).toBe(false);
|
||||
});
|
||||
it('contains only the four supported product modules', () => {
|
||||
expect(MODULE_ACCESS_KEYS).toEqual(['programming', 'design', 'robot', 'cloud_agents']);
|
||||
expect(DEFAULT_MODULE_ACCESS).toEqual({
|
||||
programming: true,
|
||||
design: true,
|
||||
robot: true,
|
||||
cloud_agents: true,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -27,6 +35,7 @@ describe('module access projection', () => {
|
||||
programming: false,
|
||||
design: true,
|
||||
robot: false,
|
||||
cloud_agents: true,
|
||||
});
|
||||
expect(access).not.toHaveProperty('learning');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user