mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-23 22:47:19 +00:00
test: add extra tests (#3428)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user