Add literal-value assertion for location_entity_ref in store test

Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
This commit is contained in:
Fredrik Adelöw
2026-04-05 10:37:32 +02:00
parent 2514e30734
commit 6941ae10f3
@@ -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<DbLocationsRow>('locations').where(
'id',
created.id,
);
// Hardcoded expected value: sha1('url:<target>') lowercased via stringifyEntityRef
expect(row.location_entity_ref).toBe(
'location:default/generated-fa35d9c166e43ab7f4a7c59a00e88e4e8b5aba34',
);
},
);
});
describe('deleteLocation', () => {