This commit is contained in:
ryan
2026-07-13 15:08:40 +08:00
parent 08e8eea932
commit 1eff7878a1
441 changed files with 26491 additions and 18405 deletions
@@ -1,6 +1,6 @@
import {describe, expect, it} from 'vitest';
import { describe, expect, it } from 'vitest';
import {resolveZoneDomainInput} from '@/app/(main)/websites/components/resolve-zone-domain-input';
import { resolveZoneDomainInput } from '@/app/(main)/websites/components/resolve-zone-domain-input';
describe('resolveZoneDomainInput', () => {
it('maps short label and apex @ under zone root', () => {
@@ -13,7 +13,9 @@ describe('resolveZoneDomainInput', () => {
});
it('accepts full FQDN under the zone', () => {
expect(resolveZoneDomainInput('www.api.example.com', 'example.com')).toEqual({
expect(
resolveZoneDomainInput('www.api.example.com', 'example.com'),
).toEqual({
domain: 'www.api.example.com',
});
expect(resolveZoneDomainInput('example.com', 'example.com')).toEqual({
@@ -22,7 +24,11 @@ describe('resolveZoneDomainInput', () => {
});
it('rejects foreign domains and wildcards', () => {
expect(resolveZoneDomainInput('evil.com', 'example.com').error).toBeTruthy();
expect(resolveZoneDomainInput('*.example.com', 'example.com').error).toBeTruthy();
expect(
resolveZoneDomainInput('evil.com', 'example.com').error,
).toBeTruthy();
expect(
resolveZoneDomainInput('*.example.com', 'example.com').error,
).toBeTruthy();
});
});