michael-s-molina commented on code in PR #20555:
URL: https://github.com/apache/superset/pull/20555#discussion_r910977178


##########
superset-frontend/packages/superset-ui-chart-controls/test/utils/getColorFormatters.test.ts:
##########
@@ -50,6 +50,8 @@ describe('getOpacity', () => {
     expect(getOpacity(100, 100, 50)).toEqual(0.05);
     expect(getOpacity(100, 100, 100, 0, 0.8)).toEqual(0.8);
     expect(getOpacity(100, 100, 50, 0, 1)).toEqual(0);
+    expect(getOpacity(999, 100, 50, 0, 1)).toEqual(1);
+    expect(getOpacity(-999, 100, 50, 0, 1)).toEqual(0.05);

Review Comment:
   `Math.abs` inside the function will make sure `result` is never negative. We 
can replace this test with one that passes a high `minOpacity` like `0.9` and 
parameters that make `result` be less than this value to test `result < 
minOpacity`
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to