diff --git a/superset-frontend/src/utils/common.js b/superset-frontend/src/utils/common.js index 400a7d05e0109..4283554138c97 100644 --- a/superset-frontend/src/utils/common.js +++ b/superset-frontend/src/utils/common.js @@ -66,10 +66,10 @@ export function optionLabel(opt) { return EMPTY_STRING; } if (opt === true) { - return ''; + return TRUE_STRING; } if (opt === false) { - return ''; + return FALSE_STRING; } if (typeof opt !== 'string' && opt.toString) { return opt.toString(); diff --git a/superset-frontend/src/utils/common.test.jsx b/superset-frontend/src/utils/common.test.jsx index 571e493addbff..59cba6e7b2d0c 100644 --- a/superset-frontend/src/utils/common.test.jsx +++ b/superset-frontend/src/utils/common.test.jsx @@ -21,6 +21,8 @@ import { optionFromValue, prepareCopyToClipboardTabularData, NULL_STRING, + TRUE_STRING, + FALSE_STRING, } from 'src/utils/common'; describe('utils/common', () => { @@ -28,9 +30,12 @@ describe('utils/common', () => { it('converts values as expected', () => { expect(optionFromValue(false)).toEqual({ value: false, - label: '', + label: FALSE_STRING, + }); + expect(optionFromValue(true)).toEqual({ + value: true, + label: TRUE_STRING, }); - expect(optionFromValue(true)).toEqual({ value: true, label: '' }); expect(optionFromValue(null)).toEqual({ value: NULL_STRING, label: NULL_STRING,