mirror of
https://github.com/langgenius/dify.git
synced 2026-04-15 18:06:36 +08:00
Co-authored-by: CodingOnStar <hanxujiang@dify.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
34 lines
651 B
TypeScript
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: '工作流',
|
|
})
|
|
})
|
|
})
|