remove target from catalog tests
Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
committed by
Fredrik Adelöw
parent
ba6d2fecec
commit
cdb623445e
@@ -469,62 +469,6 @@ describe('DefaultEntitiesCatalog', () => {
|
||||
expect(entities.length).toBe(0);
|
||||
},
|
||||
);
|
||||
|
||||
it.each(databases.eachSupportedId())(
|
||||
'should return both target and targetRef for entities',
|
||||
async databaseId => {
|
||||
const { knex } = await createDatabase(databaseId);
|
||||
await addEntity(
|
||||
knex,
|
||||
{
|
||||
apiVersion: 'a',
|
||||
kind: 'k',
|
||||
metadata: { name: 'one' },
|
||||
spec: {},
|
||||
relations: [{ type: 'r', targetRef: 'x:y/z' } as any],
|
||||
},
|
||||
[],
|
||||
);
|
||||
await addEntity(
|
||||
knex,
|
||||
{
|
||||
apiVersion: 'a',
|
||||
kind: 'k',
|
||||
metadata: { name: 'two' },
|
||||
spec: {},
|
||||
relations: [
|
||||
{
|
||||
type: 'r',
|
||||
target: { kind: 'x', namespace: 'y', name: 'z' },
|
||||
} as any,
|
||||
],
|
||||
},
|
||||
[],
|
||||
);
|
||||
const catalog = new DefaultEntitiesCatalog(knex);
|
||||
|
||||
const { entities } = await catalog.entities();
|
||||
|
||||
expect(
|
||||
entities.find(e => e.metadata.name === 'one')!.relations,
|
||||
).toEqual([
|
||||
{
|
||||
type: 'r',
|
||||
targetRef: 'x:y/z',
|
||||
target: { kind: 'x', namespace: 'y', name: 'z' },
|
||||
},
|
||||
]);
|
||||
expect(
|
||||
entities.find(e => e.metadata.name === 'two')!.relations,
|
||||
).toEqual([
|
||||
{
|
||||
type: 'r',
|
||||
targetRef: 'x:y/z',
|
||||
target: { kind: 'x', namespace: 'y', name: 'z' },
|
||||
},
|
||||
]);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
describe('removeEntityByUid', () => {
|
||||
|
||||
@@ -94,11 +94,6 @@ describe('Stitcher', () => {
|
||||
{
|
||||
type: 'looksAt',
|
||||
targetRef: 'k:ns/other',
|
||||
target: {
|
||||
kind: 'k',
|
||||
namespace: 'ns',
|
||||
name: 'other',
|
||||
},
|
||||
},
|
||||
],
|
||||
apiVersion: 'a',
|
||||
@@ -160,20 +155,10 @@ describe('Stitcher', () => {
|
||||
{
|
||||
type: 'looksAt',
|
||||
targetRef: 'k:ns/other',
|
||||
target: {
|
||||
kind: 'k',
|
||||
namespace: 'ns',
|
||||
name: 'other',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'looksAt',
|
||||
targetRef: 'k:ns/third',
|
||||
target: {
|
||||
kind: 'k',
|
||||
namespace: 'ns',
|
||||
name: 'third',
|
||||
},
|
||||
},
|
||||
]),
|
||||
apiVersion: 'a',
|
||||
|
||||
Reference in New Issue
Block a user