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