Skip to content

Commit

Permalink
[PR feedback] Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Feb 25, 2021
1 parent 3e5b31b commit 814152f
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ describe('CurationQueries', () => {
expect(actions.addQuery).toHaveBeenCalled();
});

it('disables the add button if any query fields are empty', () => {
setMockValues({
...values,
queries: ['a', '', 'c'],
hasEmptyQueries: true,
});
const wrapper = shallow(<CurationQueries {...props} />);
const button = wrapper.find('[data-test-subj="addCurationQueryButton"]');

expect(button.prop('isDisabled')).toEqual(true);
});

it('calls the passed onSubmit callback when the submit button is clicked', () => {
setMockValues({ ...values, queries: ['some query'] });
const wrapper = shallow(<CurationQueries {...props} />);
Expand Down

0 comments on commit 814152f

Please sign in to comment.