Skip to content

Commit

Permalink
AG-1412 update unit tests to test null/undefined pValues for getCircl…
Browse files Browse the repository at this point in the history
…eSize()
  • Loading branch information
sagely1 committed Apr 4, 2024
1 parent 9604783 commit 3b28333
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3b28333

Please sign in to comment.