fix(waf): complete geography match options

Use full country and ISO subdivision data, show localized country names with codes, and add searchable region selection.
This commit is contained in:
ryan
2026-07-13 16:34:18 +08:00
parent a61d55bb1b
commit 0c2961ae6d
10 changed files with 179 additions and 75 deletions
@@ -0,0 +1,23 @@
import { describe, expect, it } from 'vitest';
import { countryOptions, regionOptions } from './geo-options';
describe('geo options', () => {
it('contains the complete country list with localized names', () => {
expect(countryOptions).toHaveLength(249);
expect(countryOptions).toContainEqual(
expect.objectContaining({ value: 'CN', label: '中国' }),
);
});
it('contains searchable ISO subdivision options', () => {
expect(regionOptions.length).toBeGreaterThan(4000);
expect(regionOptions).toContainEqual(
expect.objectContaining({
value: 'CN-BJ',
label: expect.stringContaining('Beijing'),
searchText: expect.stringContaining('中国'),
}),
);
});
});