From 3e6436ef71a85f3b9a771aae4144d3ab13e55d0e Mon Sep 17 00:00:00 2001 From: Dries Augustyns Date: Wed, 13 May 2026 21:55:40 +0200 Subject: [PATCH] fix: update test to ensure mixed-case domain names are canonicalized to lowercase --- apps/api/src/__tests__/integration/domains.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/api/src/__tests__/integration/domains.test.ts b/apps/api/src/__tests__/integration/domains.test.ts index 8907ceb..159b640 100644 --- a/apps/api/src/__tests__/integration/domains.test.ts +++ b/apps/api/src/__tests__/integration/domains.test.ts @@ -374,13 +374,14 @@ describe('Domain Verification and Ownership Tests', () => { // EDGE CASES // ======================================== describe('Edge Cases', () => { - it('should handle case-sensitive domain names', async () => { + it('should canonicalize mixed-case domain names to lowercase', async () => { const {project} = await factories.createUserWithProject(); - // Domains are typically case-insensitive in DNS, but stored as-is in DB + // DNS is case-insensitive — domains must be stored canonically so a tenant + // can't claim "Example.com" while another project owns "example.com". const domain1 = await DomainService.addDomain(project.id, 'Example.com'); - expect(domain1.domain).toBe('Example.com'); + expect(domain1.domain).toBe('example.com'); }); it('should handle subdomain vs root domain', async () => {