Skip to content

Commit

Permalink
Fix search.maxLimit configuration (#533)
Browse files Browse the repository at this point in the history
* Fix the way of getting search.maxLimit configuration

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Add tests for srarch.maxLimit configuration

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
  • Loading branch information
rubenvp8510 and yurishkuro authored Mar 9, 2020
1 parent 0882bde commit f158a12
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import * as jaegerApiActions from '../../actions/jaeger-api';
import { formatDate, formatTime } from '../../utils/date';
import reduxFormFieldAdapter from '../../utils/redux-form-field-adapter';
import { DEFAULT_OPERATION, DEFAULT_LIMIT, DEFAULT_LOOKBACK } from '../../constants/search-form';
import getConfigValue from '../../utils/config/get-config';
import { getConfigValue } from '../../utils/config/get-config';
import './SearchForm.css';

const FormItem = Form.Item;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,19 @@ describe('<SearchForm>', () => {
btn = wrapper.find(`[data-test="${markers.SUBMIT_BTN}"]`);
expect(btn.prop('disabled')).toBeTruthy();
});

it('uses config.search.maxLimit', () => {
const maxLimit = 6789;
const config = {
search: {
maxLimit,
},
};
window.getJaegerUiConfig = jest.fn(() => config);
wrapper = shallow(<SearchForm {...defaultProps} selectedService="svcA" />);
const field = wrapper.find(`Field[name="resultsLimit"]`);
expect(field.prop('props').max).toEqual(maxLimit);
});
});

describe('validation', () => {
Expand Down

0 comments on commit f158a12

Please sign in to comment.