mirror of
https://github.com/langgenius/dify.git
synced 2026-07-21 18:58:35 +08:00
22 lines
1017 B
TypeScript
22 lines
1017 B
TypeScript
import { agent } from '@dify/contracts/api/console/agent/orpc.gen'
|
|
import { apps } from '@dify/contracts/api/console/apps/orpc.gen'
|
|
import { notification } from '@dify/contracts/api/console/notification/orpc.gen'
|
|
import { tags } from '@dify/contracts/api/console/tags/orpc.gen'
|
|
import { workspaces } from '@dify/contracts/api/console/workspaces/orpc.gen'
|
|
import { describe, expect, it } from 'vitest'
|
|
import { loadConsoleContractForSegment } from './console-router-loader'
|
|
|
|
describe('loadConsoleContractForSegment', () => {
|
|
it.each([
|
|
['agent', 'agent', agent],
|
|
['apps', 'apps', apps],
|
|
['notification', 'notification', notification],
|
|
['tags', 'tags', tags],
|
|
['workspaces', 'workspaces', workspaces],
|
|
] as const)('loads the generated %s contract when generated types are usable', async (segment, contractKey, generatedContract) => {
|
|
const contract = await loadConsoleContractForSegment(segment)
|
|
|
|
expect((contract as Record<string, unknown>)[contractKey]).toBe(generatedContract)
|
|
})
|
|
})
|