Download react-boilerplate/app/containers/App/tests/actions.test.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-boilerplate/app/containers/App/tests/actions.test.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-boilerplate/app/containers/App/tests/actions.test.js
-
curl -L -o actions.test.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-boilerplate/app/containers/App/tests/actions.test.js
1.12 kB
| import { LOAD_REPOS, LOAD_REPOS_SUCCESS, LOAD_REPOS_ERROR } from '../constants'; | |
| import { loadRepos, reposLoaded, repoLoadingError } from '../actions'; | |
| describe('App Actions', () => { | |
| describe('loadRepos', () => { | |
| it('should return the correct type', () => { | |
| const expectedResult = { | |
| type: LOAD_REPOS, | |
| }; | |
| expect(loadRepos()).toEqual(expectedResult); | |
| }); | |
| }); | |
| describe('reposLoaded', () => { | |
| it('should return the correct type and the passed repos', () => { | |
| const fixture = ['Test']; | |
| const username = 'test'; | |
| const expectedResult = { | |
| type: LOAD_REPOS_SUCCESS, | |
| repos: fixture, | |
| username, | |
| }; | |
| expect(reposLoaded(fixture, username)).toEqual(expectedResult); | |
| }); | |
| }); | |
| describe('repoLoadingError', () => { | |
| it('should return the correct type and the error', () => { | |
| const fixture = { | |
| msg: 'Something went wrong!', | |
| }; | |
| const expectedResult = { | |
| type: LOAD_REPOS_ERROR, | |
| error: fixture, | |
| }; | |
| expect(repoLoadingError(fixture)).toEqual(expectedResult); | |
| }); | |
| }); | |
| }); | |