From 156d9ddf78df336db7cbcd8cddeb90169de02fd4 Mon Sep 17 00:00:00 2001 From: Matthew Daubney Date: Mon, 9 Nov 2026 21:59:40 +0000 Subject: [PATCH] Tests: don't search the database config for a password that equals the username Co-Authored-By: Claude Sonnet 5.5 --- src/api/engines/database.integration.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/engines/database.integration.test.ts b/src/api/engines/database.integration.test.ts index 7558ab7..629bc59 100644 --- a/src/api/engines/database.integration.test.ts +++ b/src/api/engines/database.integration.test.ts @@ -33,7 +33,9 @@ describe.skipIf(!pg)('database engine against Postgres', () => { const read = await readConfig(client, mount, conn, 'app') expect(read).toMatchObject({ plugin_name: 'postgresql-database-plugin', username: pg!.values.username }) expect(String(read!.connection_url)).toContain('{{username}}') - expect(JSON.stringify(read)).not.toContain(String(pg!.values.password)) + // Not a substring search: CI's password ("postgres") is also the username and the hostname. + expect(read).not.toHaveProperty('password') + expect(JSON.stringify(read)).not.toContain(`:${String(pg!.values.password)}@`) // editing with the password left blank must keep the stored one, or the next credential request would fail const edit = draftFromRole(conn, 'app', read!)