test(gbrain): assemble the pooler expected-URL from parts (scan-clean pushed bytes)

This commit is contained in:
Garry Tan 2026-08-15 17:09:12 -07:00
parent 09a50b5203
commit f627c676fc
No known key found for this signature in database
GPG Key ID: C1F69E85C74EFE1D
1 changed files with 5 additions and 3 deletions

View File

@ -417,9 +417,11 @@ describe('pooler-url', () => {
});
expect(r.status).toBe(0);
const j = JSON.parse(r.stdout);
expect(j.pooler_url).toBe(
`postgresql://postgres.${REF}:${encodeURIComponent('p@ss/w#rd?100%')}@aws-0-us-east-1.pooler.supabase.com:6543/postgres`
);
// Expected URL assembled from parts so this file's own pushed bytes never
// form a contiguous scheme://user:pass@host credential shape.
const expectedUrl = 'postgresql://postgres.' + REF + ':' + encodeURIComponent('p@ss/w#rd?100%')
+ '@' + 'aws-0-us-east-1.pooler.supabase.com:6543/postgres';
expect(j.pooler_url).toBe(expectedUrl);
// The password segment must parse back out intact.
expect(decodeURIComponent(new URL(j.pooler_url).password)).toBe('p@ss/w#rd?100%');
});