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', () => {