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:
Deqiying
2026-11-09 10:31:03 +08:00
committed by GitHub
parent 8d8b3e1ea8
commit 9a51a68206
37 changed files with 1614 additions and 113 deletions
@@ -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('*');
}
});
});