Download wp-calypso/client/state/selectors/test/get-jetpack-connection-status.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 823 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/selectors/test/get-jetpack-connection-status.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/selectors/test/get-jetpack-connection-status.js
-
curl -L -o get-jetpack-connection-status.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/selectors/test/get-jetpack-connection-status.js
823 Bytes
| import getJetpackConnectionStatus from 'calypso/state/selectors/get-jetpack-connection-status'; | |
| import { items as ITEMS_FIXTURE } from './fixtures/jetpack-connection'; | |
| describe( 'getJetpackConnectionStatus()', () => { | |
| test( 'should return connection status for a known site', () => { | |
| const stateIn = { | |
| jetpack: { | |
| connection: { | |
| items: ITEMS_FIXTURE, | |
| }, | |
| }, | |
| }; | |
| const siteId = 12345678; | |
| const output = getJetpackConnectionStatus( stateIn, siteId ); | |
| expect( output ).toEqual( ITEMS_FIXTURE[ siteId ] ); | |
| } ); | |
| test( 'should return null for an unknown site', () => { | |
| const stateIn = { | |
| jetpack: { | |
| connection: { | |
| items: ITEMS_FIXTURE, | |
| }, | |
| }, | |
| }; | |
| const siteId = 88888888; | |
| const output = getJetpackConnectionStatus( stateIn, siteId ); | |
| expect( output ).toBeNull(); | |
| } ); | |
| } ); | |