diff --git a/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.component.spec.ts b/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.component.spec.ts index add7e812..ff31aab3 100644 --- a/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.component.spec.ts +++ b/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.component.spec.ts @@ -520,13 +520,20 @@ describe('Component: GeneComparisonToolComponent', () => { expect(label2).toBe(expected2); }); - it('should set circle size to zero for null/undefined pValues', () => { + it('should set circle size to zero for undefined pValues', () => { let tissue: GCTGeneTissue | undefined; - // null/undefined values should be zero + // undefined values should result in a circle size of zero + expect(tissue).toBeUndefined(); const result = component.getCircleSize(tissue?.adj_p_val); expect(result).toBe(0); }); + it('should set circle size to zero for null pValues', () => { + // null values should result in a circle size of zero pixels + const result = component.getCircleSize(null); + expect(result).toBe(0); + }); + it('should set circle size for pValues within acceptable ranges', () => { let expectedSizeInPixels = 0; let pValue = 0.5; diff --git a/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.component.ts b/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.component.ts index 3882c817..00856bcd 100644 --- a/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.component.ts +++ b/src/app/features/genes/components/gene-comparison-tool/gene-comparison-tool.component.ts @@ -901,7 +901,7 @@ export class GeneComparisonToolComponent implements OnInit, AVI, OnDestroy { } } - getCircleSize(pval: number | undefined) { + getCircleSize(pval: number | null | undefined) { // define min and max size of possible circles in pixels const MIN_SIZE = 6; const MAX_SIZE = 50;