From: Daniel Kutyła Date: Thu, 27 Aug 2020 16:25:04 +0000 (+0200) Subject: 16743: Removed console.log's updated tests X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/a31a8fcb90d15b9810d36f4e3c8cb79b4e5f8ef9?hp=b71d59f7e1876c9eb20c2aa7c749c0acc8568b6f 16743: Removed console.log's updated tests Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła --- diff --git a/src/views-components/side-panel-button/side-panel-button.test.tsx b/src/views-components/side-panel-button/side-panel-button.test.tsx index 056b2e6467..9704be71ab 100644 --- a/src/views-components/side-panel-button/side-panel-button.test.tsx +++ b/src/views-components/side-panel-button/side-panel-button.test.tsx @@ -6,6 +6,18 @@ import { isProjectTrashed } from './side-panel-button'; describe('', () => { describe('isProjectTrashed', () => { + it('should return false if project is undefined', () => { + // given + const proj = undefined; + const resources = {}; + + // when + const result = isProjectTrashed(proj, resources); + + // then + expect(result).toBeFalsy(); + }); + it('should return false if parent project is undefined', () => { // given const proj = {}; @@ -46,7 +58,7 @@ describe('', () => { expect(result).toBeTruthy(); }); - it.only('should return false for undefined parent projects', () => { + it('should return false for undefined parent projects', () => { // given const proj = { ownerUuid: 'ce8i5-j7d0g-000000000000000', diff --git a/src/views-components/side-panel-button/side-panel-button.tsx b/src/views-components/side-panel-button/side-panel-button.tsx index 58cceafb7f..3ca2f0d66e 100644 --- a/src/views-components/side-panel-button/side-panel-button.tsx +++ b/src/views-components/side-panel-button/side-panel-button.tsx @@ -54,13 +54,12 @@ const transformOrigin: PopoverOrigin = { horizontal: 0 }; -export const isProjectTrashed = (proj: GroupResource, resources: ResourcesState): boolean => { +export const isProjectTrashed = (proj: GroupResource | undefined, resources: ResourcesState): boolean => { if (proj === undefined) { return false; } if (proj.isTrashed) { return true; } if (extractUuidKind(proj.ownerUuid) === ResourceKind.USER) { return false; } const parentProj = getResource(proj.ownerUuid)(resources); - console.log(1); - return isProjectTrashed(parentProj!, resources); + return isProjectTrashed(parentProj, resources); }; export const SidePanelButton = withStyles(styles)(