Created
February 25, 2019 15:10
-
-
Save niinpatel/afea86d50ac4417a5192a9545b7ece76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { act } from 'react-dom/test-utils'; | |
import { testHook } from './testUtils'; | |
import useTextField from '../useTextField'; | |
let nameField; | |
beforeEach(() => { | |
testHook(() => { | |
nameField = useTextField('name'); | |
}); | |
}); | |
describe('useTextField', () => { | |
test('should have an onChange function', () => { | |
expect(nameField.onChange).toBeInstanceOf(Function); | |
}); | |
test('should have correct name', () => { | |
expect(nameField.name).toBe('name'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment