43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { mergeListingPublishOptions } from './listingOptions'
|
|
|
|
describe('mergeListingPublishOptions', () => {
|
|
it('保留配置结构版本,避免保存时触发旧版迁移', () => {
|
|
const options = mergeListingPublishOptions({
|
|
schema_version: 2,
|
|
})
|
|
|
|
expect(options.schema_version).toBe(2)
|
|
})
|
|
|
|
it('读取后台配置的押金说明', () => {
|
|
const options = mergeListingPublishOptions({
|
|
price_config: {
|
|
deposit_placeholder: '',
|
|
deposit_hint: '',
|
|
deposit_tooltip: '自定义押金说明',
|
|
price_placeholder: '',
|
|
ratio_description: '',
|
|
},
|
|
})
|
|
|
|
expect(options.price_config.deposit_tooltip).toBe('自定义押金说明')
|
|
})
|
|
|
|
it('读取后台配置的赔付方案说明', () => {
|
|
const options = mergeListingPublishOptions({
|
|
price_config: {
|
|
deposit_placeholder: '',
|
|
deposit_hint: '',
|
|
deposit_tooltip: '',
|
|
compensation_note: '自定义赔付方案说明',
|
|
price_placeholder: '',
|
|
ratio_description: '',
|
|
},
|
|
})
|
|
|
|
expect(options.price_config.compensation_note).toBe('自定义赔付方案说明')
|
|
})
|
|
})
|