v4.0.18版本提交

This commit is contained in:
2026-09-08 10:07:34 +08:00
parent 4bdb09068c
commit 23ba639e9b
46 changed files with 1922 additions and 162 deletions
+31
View File
@@ -0,0 +1,31 @@
import { describe, expect, it } from 'vitest';
import { formatStoreDisplayAddress } from './store-address';
describe('formatStoreDisplayAddress', () => {
it('concatenates dropdown region with street-only detail', () => {
expect(
formatStoreDisplayAddress({
province: '河南省',
cityName: '郑州市',
district: '金水区',
address: '金水东路333号',
}),
).toBe('河南省郑州市金水区金水东路333号');
});
it('does not strip region prefix already present in detail', () => {
expect(
formatStoreDisplayAddress({
province: '河南省',
cityName: '郑州市',
district: '金水区',
address: '河南省郑州市金水区金水东路333号',
}),
).toBe('河南省郑州市金水区河南省郑州市金水区金水东路333号');
});
it('returns fallback when all parts are empty', () => {
expect(formatStoreDisplayAddress({})).toBe('地址待完善');
expect(formatStoreDisplayAddress({}, '')).toBe('');
});
});