Add encrypted DNS presets (#5837)

This commit is contained in:
Rouzbeh†
2026-07-09 02:15:35 +03:30
committed by GitHub
parent 7780ab0e23
commit b8a654967f
19 changed files with 128 additions and 25 deletions
+19
View File
@@ -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);
}
});
});