Download react-hook-form/src/__tests__/logic/getFocusFieldName.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 526 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/__tests__/logic/getFocusFieldName.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-hook-form/src/__tests__/logic/getFocusFieldName.test.ts
-
curl -L -o getFocusFieldName.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/__tests__/logic/getFocusFieldName.test.ts
526 Bytes
| import getFocusFieldName from '../../logic/getFocusFieldName'; | |
| describe('getFocusFieldName', () => { | |
| it('should return expected focus name', () => { | |
| expect(getFocusFieldName('test', 0, { shouldFocus: false })).toEqual(''); | |
| expect( | |
| getFocusFieldName('test', 0, { shouldFocus: true, focusName: 'test' }), | |
| ).toEqual('test'); | |
| expect( | |
| getFocusFieldName('test', 0, { shouldFocus: true, focusIndex: 1 }), | |
| ).toEqual('test.1.'); | |
| expect(getFocusFieldName('test', 0)).toEqual('test.0.'); | |
| }); | |
| }); | |