16743: Removed console.log's updated tests 16743-blank-page-for-some-links
authorDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Thu, 27 Aug 2020 16:25:04 +0000 (18:25 +0200)
committerDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Thu, 27 Aug 2020 16:25:04 +0000 (18:25 +0200)
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>

src/views-components/side-panel-button/side-panel-button.test.tsx
src/views-components/side-panel-button/side-panel-button.tsx

index 056b2e6467d319fa0ee087644776eec063978c48..9704be71ab6d80d073d5b1d0cd99942334a9e7fe 100644 (file)
@@ -6,6 +6,18 @@ import { isProjectTrashed } from './side-panel-button';
 
 describe('<SidePanelButton />', () => {
     describe('isProjectTrashed', () => {
 
 describe('<SidePanelButton />', () => {
     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 = {};
         it('should return false if parent project is undefined', () => {
             // given
             const proj = {};
@@ -46,7 +58,7 @@ describe('<SidePanelButton />', () => {
             expect(result).toBeTruthy();
         });
 
             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',
             // given
             const proj = {
                 ownerUuid: 'ce8i5-j7d0g-000000000000000',
index 58cceafb7ff7c3a1e712bde53ed68d124f3d7372..3ca2f0d66e95d4cc552c54a70ca27f4644063d96 100644 (file)
@@ -54,13 +54,12 @@ const transformOrigin: PopoverOrigin = {
     horizontal: 0
 };
 
     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<GroupResource>(proj.ownerUuid)(resources);
     if (proj === undefined) { return false; }
     if (proj.isTrashed) { return true; }
     if (extractUuidKind(proj.ownerUuid) === ResourceKind.USER) { return false; }
     const parentProj = getResource<GroupResource>(proj.ownerUuid)(resources);
-    console.log(1);
-    return isProjectTrashed(parentProj!, resources);
+    return isProjectTrashed(parentProj, resources);
 };
 
 export const SidePanelButton = withStyles(styles)(
 };
 
 export const SidePanelButton = withStyles(styles)(