瀏覽代碼

Fixed the test associated with blur event

Snow 8 年之前
父節點
當前提交
60e970ccae
共有 1 個文件被更改,包括 2 次插入2 次删除
  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);
   });