mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-12 07:36:07 +00:00
Add encrypted DNS presets (#5837)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { PRESETS } from '@/pages/xray/dns/DnsPresetsModal';
|
||||
import { DnsObjectSchema, DnsServerObjectSchema } from '@/schemas/dns';
|
||||
|
||||
describe('DNS presets', () => {
|
||||
it('include encrypted presets accepted by xray DNS config', () => {
|
||||
const servers = PRESETS.flatMap((preset) => preset.data);
|
||||
|
||||
expect(servers).toContain('https://freedns.controld.com/p2');
|
||||
expect(servers).toContain('quic+local://p2.freedns.controld.com');
|
||||
expect(servers).toContain('https://dns.google/dns-query');
|
||||
expect(servers.every((server) => !server.startsWith('tls://'))).toBe(true);
|
||||
expect(DnsObjectSchema.parse({ servers }).servers).toEqual(servers);
|
||||
for (const server of servers) {
|
||||
expect(DnsServerObjectSchema.parse({ address: server }).address).toBe(server);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user