Files
OpenFlare/frontend/app/(main)/waf/rules/editor/components/geo-options.test.ts
T
ryan 0c2961ae6d fix(waf): complete geography match options
Use full country and ISO subdivision data, show localized country names with codes, and add searchable region selection.
2026-07-13 16:34:18 +08:00

24 lines
731 B
TypeScript

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('中国'),
}),
);
});
});