mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-11-16 23:04:24 +08:00
feat(domain): 支持通配符域名及关联功能适配 (#63)
* feat(domain): 支持通配符域名及关联功能适配 * fix(domain): preserve legacy Unicode imports and address review findings * fix(domain): canonicalize legacy IDNs and exclude empty host labels * fix(domain): normalize equivalent Unicode IDN spellings --------- Co-authored-by: Ryan <63696351+Rain-kl@users.noreply.github.com> Co-authored-by: ryan <ryan@arctel.net>
This commit is contained in:
@@ -110,4 +110,28 @@ describe('ZoneDomainSelector', () => {
|
||||
expect(screen.getByText('bound.example.com')).toBeVisible();
|
||||
expect(screen.getByText('api.example.com')).toBeVisible();
|
||||
});
|
||||
|
||||
it('searches and selects wildcard domains by ID without generating wildcard URLs', async () => {
|
||||
const user = userEvent.setup();
|
||||
const onChange = vi.fn();
|
||||
renderSelector(
|
||||
<ZoneDomainSelector
|
||||
value={[]}
|
||||
onChange={onChange}
|
||||
domains={[
|
||||
...domains,
|
||||
{ ...domains[0], id: 9, domain: '*.s3.example.com' },
|
||||
]}
|
||||
zones={zones}
|
||||
/>,
|
||||
);
|
||||
|
||||
await user.type(screen.getByRole('textbox'), '*.s3');
|
||||
expect(screen.queryByText('api.example.com')).not.toBeInTheDocument();
|
||||
await user.click(screen.getByText('*.s3.example.com'));
|
||||
expect(onChange).toHaveBeenCalledWith([9]);
|
||||
for (const link of screen.getAllByRole('link')) {
|
||||
expect(link.getAttribute('href')).not.toContain('*');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user