test: add extra tests (#3428)

This commit is contained in:
Daniel Salazar
2026-07-22 21:13:44 -07:00
committed by GitHub
parent 5faed55076
commit e35b57068b
@@ -1396,6 +1396,23 @@ describe('AuthService (integration)', () => {
).resolves.toBeNull();
});
it('returns null for a subdomain of the main domain', async () => {
// `<sub>.puter.localhost` sits under the main `domain`, not a
// hosting domain — no owner resolves even when a subdomain row
// with the same name exists.
const user = await makeUser();
const subdomain = `own-${Math.random().toString(36).slice(2, 10)}`;
await server.stores.subdomain.create({
userId: user.id,
subdomain,
});
await expect(
authService.subdomainOwnerIdFromOrigin(
`https://${subdomain}.puter.localhost`,
),
).resolves.toBeNull();
});
it('returns null for an unregistered subdomain and for the apex host', async () => {
await expect(
authService.subdomainOwnerIdFromOrigin(