Browse Source

Fixed the test associated with blur event

Snow 8 years ago
parent
commit
60e970ccae
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/__test__/Form.test.js

+ 2 - 2
src/__test__/Form.test.js

@@ -62,7 +62,7 @@ describe('Validation', () => {
     expect(warning2.find('span.warning').length).toBe(0);
   });
 
-  it('Exceeding the max length shows a warning on submit', () => {
+  it('Exceeding the min length shows a warning on submit', () => {
     const formWindow = mount(<Form />);
     const inputField = formWindow.find('input').at(0);
     const name = inputField.prop('name');
@@ -70,7 +70,7 @@ describe('Validation', () => {
     inputField.simulate('change', {
       target: { name: name, value: newValue }
     });
-    formWindow.find('input').last().simulate('submit');
+    inputField.simulate('blur')
     expect(formWindow.find('.warning').at(0).length).toBe(1);
   });