From 293e6aee192adbfbd88cbd87bc32539892d32d7c Mon Sep 17 00:00:00 2001 From: Paul Schultz Date: Tue, 4 Apr 2023 14:31:35 -0500 Subject: [PATCH] Remove test for the TODO code snippet Signed-off-by: Paul Schultz --- .changeset/curly-rats-fold.md | 73 +++++++++++++++++++ .../service/DefaultEntitiesCatalog.test.ts | 58 --------------- 2 files changed, 73 insertions(+), 58 deletions(-) diff --git a/.changeset/curly-rats-fold.md b/.changeset/curly-rats-fold.md index a5ea89b98e..a20fc4d288 100644 --- a/.changeset/curly-rats-fold.md +++ b/.changeset/curly-rats-fold.md @@ -3,6 +3,7 @@ --- - Finished TODO to remove code snippet that was supposed to be removed in April 2022 +- Removed test for the TODO code snippet - Refactored `parsePagination()`, `stringifyPagination()`, and `addCondition()` to be more readable - In `parseFilter()`, the `isNegationEntityFilter` check is earlier for faster recursion @@ -181,3 +182,75 @@ index ba165f96af..2023c19e13 100644 entities, pageInfo, ``` + +```diff +diff --git a/plugins/catalog-backend/src/service/DefaultEntitiesCatalog.test.ts b/plugins/catalog-backend/src/service/DefaultEntitiesCatalog.test.ts +index 08ae295834..31d4d06971 100644 +--- a/plugins/catalog-backend/src/service/DefaultEntitiesCatalog.test.ts ++++ b/plugins/catalog-backend/src/service/DefaultEntitiesCatalog.test.ts +@@ -507,64 +507,6 @@ describe('DefaultEntitiesCatalog', () => { + }, + ); + +- it.each(databases.eachSupportedId())( +- 'should return both target and targetRef for entities', +- async databaseId => { +- await createDatabase(databaseId); +- await addEntity( +- { +- apiVersion: 'a', +- kind: 'k', +- metadata: { name: 'one' }, +- spec: {}, +- relations: [{ type: 'r', targetRef: 'x:y/z' } as any], +- }, +- [], +- ); +- await addEntity( +- { +- apiVersion: 'a', +- kind: 'k', +- metadata: { name: 'two' }, +- spec: {}, +- relations: [ +- { +- type: 'r', +- target: { kind: 'x', namespace: 'y', name: 'z' }, +- } as any, +- ], +- }, +- [], +- ); +- const catalog = new DefaultEntitiesCatalog({ +- database: knex, +- logger: getVoidLogger(), +- stitcher, +- }); +- +- 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' }, +- }, +- ]); +- }, +- ); +- + it.each(databases.eachSupportedId())( + 'can order and combine with filtering, %p', + async databaseId => { +``` diff --git a/plugins/catalog-backend/src/service/DefaultEntitiesCatalog.test.ts b/plugins/catalog-backend/src/service/DefaultEntitiesCatalog.test.ts index 08ae295834..31d4d06971 100644 --- a/plugins/catalog-backend/src/service/DefaultEntitiesCatalog.test.ts +++ b/plugins/catalog-backend/src/service/DefaultEntitiesCatalog.test.ts @@ -507,64 +507,6 @@ describe('DefaultEntitiesCatalog', () => { }, ); - it.each(databases.eachSupportedId())( - 'should return both target and targetRef for entities', - async databaseId => { - await createDatabase(databaseId); - await addEntity( - { - apiVersion: 'a', - kind: 'k', - metadata: { name: 'one' }, - spec: {}, - relations: [{ type: 'r', targetRef: 'x:y/z' } as any], - }, - [], - ); - await addEntity( - { - apiVersion: 'a', - kind: 'k', - metadata: { name: 'two' }, - spec: {}, - relations: [ - { - type: 'r', - target: { kind: 'x', namespace: 'y', name: 'z' }, - } as any, - ], - }, - [], - ); - const catalog = new DefaultEntitiesCatalog({ - database: knex, - logger: getVoidLogger(), - stitcher, - }); - - 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' }, - }, - ]); - }, - ); - it.each(databases.eachSupportedId())( 'can order and combine with filtering, %p', async databaseId => {