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:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user