dify/web/service/annotation.spec.ts
Stephen Zhou a84c2d36a3
style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

34 lines
811 B
TypeScript

import { AnnotationEnableStatus } from '@/app/components/app/annotation/type'
import { updateAnnotationStatus } from './annotation'
import { post } from './base'
vi.mock('./base', () => ({
post: vi.fn(),
}))
describe('annotation service', () => {
beforeEach(() => {
vi.clearAllMocks()
})
it('should preserve zero score threshold when updating annotation status', () => {
updateAnnotationStatus(
'app-1',
AnnotationEnableStatus.enable,
{
embedding_model_name: 'model',
embedding_provider_name: 'provider',
},
0,
)
expect(post).toHaveBeenCalledWith('apps/app-1/annotation-reply/enable', {
body: {
embedding_model_name: 'model',
embedding_provider_name: 'provider',
score_threshold: 0,
},
})
})
})