react-code-dataset / wp-calypso /client /state /selectors /test /get-jetpack-product-install-progress.js
react-code-dataset / wp-calypso /client /state /selectors /test /get-jetpack-product-install-progress.js
Download wp-calypso/client/state/selectors/test/get-jetpack-product-install-progress.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 736 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/selectors/test/get-jetpack-product-install-progress.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/selectors/test/get-jetpack-product-install-progress.js
-
curl -L -o get-jetpack-product-install-progress.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/selectors/test/get-jetpack-product-install-progress.js
736 Bytes
| import getJetpackProductInstallProgress from 'calypso/state/selectors/get-jetpack-product-install-progress'; | |
| describe( '#getJetpackProductInstallProgress', () => { | |
| const siteId = 12345678; | |
| test( "should return `null` when we don't have the product installation progress for this site", () => { | |
| expect( getJetpackProductInstallProgress( {}, siteId ) ).toBeNull(); | |
| } ); | |
| test( 'should return the product installation progress when we have it for this site', () => { | |
| const state = { | |
| jetpackProductInstall: { | |
| [ siteId ]: { | |
| akismet_status: 'key_not_set', | |
| progress: 60, | |
| vaultpress_status: 'key_not_set', | |
| }, | |
| }, | |
| }; | |
| expect( getJetpackProductInstallProgress( state, siteId ) ).toEqual( 60 ); | |
| } ); | |
| } ); | |