Skip to content

Commit

Permalink
Add tests for srarch.maxLimit configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
  • Loading branch information
rubenvp8510 committed Feb 27, 2020
1 parent 1dad9a1 commit a130222
Showing 1 changed file with 13 additions and 0 deletions.
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 = Math.floor(Math.random() * 7000) + 3000;
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 a130222

Please sign in to comment.