- Updated the decision structure to use 'thought' instead of 'decision' in various functions and tests. - Refactored decision-building functions to align with the new structure. - Adjusted tests to accommodate the changes in decision structure, ensuring consistency across the codebase. - Removed the delivery summary test as it was no longer relevant. - Added new tests for handling references in the brain's next action. - Introduced markdown reference parsing tests to validate reference handling.
25 lines
706 B
TypeScript
25 lines
706 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { parseRefHref } from '../../../src/renderer/src/components/markdownReference'
|
|
|
|
describe('ai unit markdown reference helpers', () => {
|
|
it('parses ncurator reference href', () => {
|
|
expect(
|
|
parseRefHref(
|
|
'ncurator://ref?label=%E6%8A%A5%E5%91%8A.docx&path=%2Ftmp%2Fworkspace%2Freport.docx&kind=internal'
|
|
)
|
|
).toEqual({
|
|
type: 'reference',
|
|
label: '报告.docx',
|
|
path: '/tmp/workspace/report.docx',
|
|
kind: 'internal'
|
|
})
|
|
})
|
|
|
|
it('passes through normal href values', () => {
|
|
expect(parseRefHref('https://openai.com')).toEqual({
|
|
type: 'normal',
|
|
href: 'https://openai.com'
|
|
})
|
|
})
|
|
})
|