Download wp-calypso/client/landing/stepper/hooks/test/use-site-id-param.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 559 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/hooks/test/use-site-id-param.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/landing/stepper/hooks/test/use-site-id-param.ts
-
curl -L -o use-site-id-param.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/hooks/test/use-site-id-param.ts
559 Bytes
| /** | |
| * @jest-environment jsdom | |
| */ | |
| import { renderHook } from '@testing-library/react'; | |
| import { useSiteIdParam } from '../use-site-id-param'; | |
| jest.mock( 'react-router-dom', () => ( { | |
| useLocation: jest.fn().mockImplementation( () => ( { | |
| pathname: '/setup', | |
| search: '?siteId=2053432885', | |
| hash: '', | |
| state: undefined, | |
| } ) ), | |
| } ) ); | |
| describe( 'use-site-id-param hook', () => { | |
| test( 'returns site id if provided', async () => { | |
| const { result } = renderHook( () => useSiteIdParam() ); | |
| expect( result.current ).toEqual( '2053432885' ); | |
| } ); | |
| } ); | |