From 44e3878a8d797892a83d065dfb478e56955ae011 Mon Sep 17 00:00:00 2001 From: dlaird-ovo Date: Wed, 15 Mar 2023 11:22:24 +0000 Subject: [PATCH] Fix review feedback Signed-off-by: dlaird-ovo --- .../components/EntitySwitch/conditions.test.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/plugins/catalog/src/components/EntitySwitch/conditions.test.ts b/plugins/catalog/src/components/EntitySwitch/conditions.test.ts index 079a6f5943..5d8c7c8898 100644 --- a/plugins/catalog/src/components/EntitySwitch/conditions.test.ts +++ b/plugins/catalog/src/components/EntitySwitch/conditions.test.ts @@ -24,18 +24,25 @@ import { const kubernetesClusterResource: Entity = { apiVersion: '', - kind: 'resource', + kind: 'Resource', metadata: { name: 'aKubernetesCluster' }, spec: { type: 'kubernetes-cluster' }, }; const databaseResource: Entity = { apiVersion: '', - kind: 'resource', + kind: 'Resource', metadata: { name: 'aDatabase' }, spec: { type: 'database' }, }; +const notResource: Entity = { + apiVersion: '', + kind: 'not-Resource', + metadata: { name: 'aService' }, + spec: { type: 'service' }, +}; + const serviceComponent: Entity = { apiVersion: '', kind: 'component', @@ -79,10 +86,10 @@ const bNamespace: Entity = { }; describe('isResourceType', () => { - it('should false on non component kinds', () => { - const checkEntity = isResourceType('service'); + it('should false on non resource kinds', () => { + const checkEntity = isResourceType('kubernetes-cluster'); - expect(checkEntity(notComponent)).not.toBeTruthy(); + expect(checkEntity(notResource)).not.toBeTruthy(); }); it('should check for the intended type', () => { const checkEntity = isResourceType('kubernetes-cluster');