Skip to content

Commit 215f59c

Browse files
committed
Remove default from byte formatting component
If the user has deleted this default, they presumably meant to do so and we shouldn't supersede it.
1 parent afd5f17 commit 215f59c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

x-pack/legacy/plugins/siem/public/components/formatted_bytes/index.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ describe('PreferenceFormattedBytes', () => {
2525
expect(toJson(wrapper)).toMatchSnapshot();
2626
});
2727

28-
test('it renders bytes to hardcoded format when no configuration exists', () => {
28+
test('it renders bytes to Numeral formatting when no format setting exists', () => {
2929
mockUseUiSetting$.mockImplementation(() => [null]);
3030
const wrapper = mount(<PreferenceFormattedBytesComponent value={bytes} />);
3131

32-
expect(wrapper.text()).toEqual('2.7MB');
32+
expect(wrapper.text()).toEqual('2,806,422');
3333
});
3434

3535
test('it renders bytes according to the default format', () => {

x-pack/legacy/plugins/siem/public/components/formatted_bytes/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { useUiSetting$ } from '../../lib/kibana';
1212

1313
export const PreferenceFormattedBytesComponent = ({ value }: { value: string | number }) => {
1414
const [bytesFormat] = useUiSetting$<string>(DEFAULT_BYTES_FORMAT);
15-
return <>{numeral(value).format(bytesFormat || '0,0.[0]b')}</>;
15+
return <>{numeral(value).format(bytesFormat)}</>;
1616
};
1717

1818
PreferenceFormattedBytesComponent.displayName = 'PreferenceFormattedBytesComponent';

0 commit comments

Comments
 (0)