feat(listings): 统一人脸情况文案并优化详情页布局

This commit is contained in:
2026-11-12 18:28:37 +08:00
parent 766369075b
commit 0359fd62cb
10 changed files with 126 additions and 34 deletions
@@ -1,6 +1,7 @@
import { describe, expect, it } from 'vitest'
import {
faceOwnerText,
listingPriceDetail,
listingRatioText,
listingResources,
@@ -149,3 +150,21 @@ describe('resourceBadgeText', () => {
)
})
})
describe('faceOwnerText', () => {
it('把是/否映射为本人/非本人', () => {
expect(faceOwnerText({ face_owner: '是' })).toBe('本人')
expect(faceOwnerText({ face_owner: '否' })).toBe('非本人')
})
it('兼容已映射文案与空值', () => {
expect(faceOwnerText({ face_owner: '本人' })).toBe('本人')
expect(faceOwnerText({ face_owner: '非本人' })).toBe('非本人')
expect(faceOwnerText({ face_owner: ' ' })).toBe('')
expect(faceOwnerText(null)).toBe('')
})
it('未知文案原样保留', () => {
expect(faceOwnerText({ face_owner: '需配合人脸' })).toBe('需配合人脸')
})
})