dify/web/app/components/tools/labels/__tests__/constant.spec.ts
Coding On Star 9948a51b14
test: add unit tests for access control components to enhance coverage and reliability (#34722)
Co-authored-by: CodingOnStar <hanxujiang@dify.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-08 08:50:57 +00:00

34 lines
651 B
TypeScript

import type { Label } from '../constant'
import { describe, expect, it } from 'vitest'
describe('tool label type contract', () => {
it('accepts string labels', () => {
const label: Label = {
name: 'agent',
label: 'Agent',
icon: 'robot',
}
expect(label).toEqual({
name: 'agent',
label: 'Agent',
icon: 'robot',
})
})
it('accepts i18n labels', () => {
const label: Label = {
name: 'workflow',
label: {
en_US: 'Workflow',
zh_Hans: '工作流',
},
}
expect(label.label).toEqual({
en_US: 'Workflow',
zh_Hans: '工作流',
})
})
})