From 6941ae10f3680f9100179822a0c7b8ced06bd0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Sun, 5 Apr 2026 10:37:32 +0200 Subject: [PATCH] Add literal-value assertion for location_entity_ref in store test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw Made-with: Cursor --- .../providers/DefaultLocationStore.test.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/plugins/catalog-backend/src/providers/DefaultLocationStore.test.ts b/plugins/catalog-backend/src/providers/DefaultLocationStore.test.ts index e4c65f8bc7..c52c122369 100644 --- a/plugins/catalog-backend/src/providers/DefaultLocationStore.test.ts +++ b/plugins/catalog-backend/src/providers/DefaultLocationStore.test.ts @@ -203,6 +203,27 @@ describe('DefaultLocationStore', () => { ); }, ); + + it.each(databases.eachSupportedId())( + 'persists the correct location_entity_ref when creating a location, %p', + async databaseId => { + const { store, knex } = await createLocationStore(databaseId); + const created = await store.createLocation({ + type: 'url', + target: + 'https://github.com/backstage/demo/blob/master/catalog-info.yml', + }); + + const [row] = await knex('locations').where( + 'id', + created.id, + ); + // Hardcoded expected value: sha1('url:') lowercased via stringifyEntityRef + expect(row.location_entity_ref).toBe( + 'location:default/generated-fa35d9c166e43ab7f4a7c59a00e88e4e8b5aba34', + ); + }, + ); }); describe('deleteLocation', () => {