From 7f23441ce571544847f788156991c4fde3b11383 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Thu, 14 Jul 2022 15:44:35 +0200 Subject: [PATCH 1/2] bump top values limit --- .../operations/definitions/terms/values_input.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/values_input.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/values_input.tsx index b244bdd54aad3..9e86ea8525adc 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/values_input.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/values_input.tsx @@ -14,7 +14,7 @@ export const ValuesInput = ({ value, onChange, minValue = 1, - maxValue = 1000, + maxValue = 10000, label = i18n.translate('xpack.lens.indexPattern.terms.size', { defaultMessage: 'Number of values', }), From f504beb56b25b7389be665c29004dc0da164f3d2 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Thu, 14 Jul 2022 16:49:29 +0200 Subject: [PATCH 2/2] fix tests --- .../definitions/terms/values_input.test.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/values_input.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/values_input.test.tsx index c94d7d05828d8..873b96b311a04 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/values_input.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/values_input.test.tsx @@ -39,16 +39,16 @@ describe('Values', () => { expect(onChangeSpy.mock.calls[0][0]).toBe(7); }); - it('should not run onChange function on update when value is out of 1-1000 range', () => { + it('should not run onChange function on update when value is out of 1-10000 range', () => { const onChangeSpy = jest.fn(); const instance = shallow(); act(() => { - instance.find(EuiFieldNumber).simulate('change', { currentTarget: { value: '1007' } }); + instance.find(EuiFieldNumber).simulate('change', { currentTarget: { value: '10007' } }); }); instance.update(); - expect(instance.find(EuiFieldNumber).prop('value')).toEqual('1007'); + expect(instance.find(EuiFieldNumber).prop('value')).toEqual('10007'); expect(onChangeSpy.mock.calls.length).toBe(1); - expect(onChangeSpy.mock.calls[0][0]).toBe(1000); + expect(onChangeSpy.mock.calls[0][0]).toBe(10000); }); it('should show an error message when the value is out of bounds', () => { @@ -60,7 +60,7 @@ describe('Values', () => { ); act(() => { - instance.find(EuiFieldNumber).simulate('change', { currentTarget: { value: '1007' } }); + instance.find(EuiFieldNumber).simulate('change', { currentTarget: { value: '10007' } }); }); instance.update(); @@ -91,10 +91,10 @@ describe('Values', () => { expect(instance.find(EuiFieldNumber).prop('isInvalid')).toBeFalsy(); expect(instance.find(EuiFieldNumber).prop('value')).toBe('1'); - changeAndBlur('5000'); + changeAndBlur('50000'); expect(instance.find(EuiFieldNumber).prop('isInvalid')).toBeFalsy(); - expect(instance.find(EuiFieldNumber).prop('value')).toBe('1000'); + expect(instance.find(EuiFieldNumber).prop('value')).toBe('10000'); changeAndBlur(''); // as we're not handling the onChange state, it fallbacks to the value prop