catalog-backend: cleanup test

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
Vincenzo Scamporlino
2023-01-28 00:33:24 +01:00
parent 2f2baf4b65
commit 9b71a220dc
@@ -1527,82 +1527,6 @@ describe('DefaultEntitiesCatalog', () => {
},
60_000,
);
it.each(databases.eachSupportedId())(
'can match relations',
async databaseId => {
await createDatabase(databaseId);
await addEntityToSearch({
apiVersion: 'a',
kind: 'k',
metadata: {
name: 'one',
tags: ['java', 'rust'],
},
spec: {},
relations: [
{
targetRef: 'targetRef',
type: 'ownedBy',
},
],
});
await addEntityToSearch({
apiVersion: 'a',
kind: 'k',
metadata: {
name: 'two',
tags: ['java', 'node'],
},
spec: {},
relations: [
{
targetRef: 'anotherTargetRef',
type: 'ownedBy',
},
{
targetRef: 'tt',
type: 'somethingelse',
},
],
});
await addEntityToSearch({
apiVersion: 'a',
kind: 'k',
metadata: {
name: 'three',
tags: ['go'],
},
spec: {},
relations: [
{
targetRef: 'targetRef',
type: 'ownedBy',
},
],
});
const catalog = new DefaultEntitiesCatalog({
database: knex,
logger: getVoidLogger(),
stitcher,
});
await expect(
catalog.facets({
facets: ['relations.ownedBy'],
}),
).resolves.toEqual({
facets: {
'relations.ownedBy': [
{ count: 1, value: 'anotherTargetRef' },
{ count: 2, value: 'targetRef' },
],
},
});
},
);
});
});