react-code-dataset / wp-calypso /client /state /selectors /test /get-jetpack-remote-install-error-code.js
react-code-dataset / wp-calypso /client /state /selectors /test /get-jetpack-remote-install-error-code.js
Download wp-calypso/client/state/selectors/test/get-jetpack-remote-install-error-code.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 661 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/selectors/test/get-jetpack-remote-install-error-code.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/selectors/test/get-jetpack-remote-install-error-code.js
-
curl -L -o get-jetpack-remote-install-error-code.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/selectors/test/get-jetpack-remote-install-error-code.js
661 Bytes
| import getJetpackRemoteInstallErrorCode from 'calypso/state/selectors/get-jetpack-remote-install-error-code'; | |
| const url = 'https://yourgroovydomain.com'; | |
| describe( 'getJetpackRemoteInstallError()', () => { | |
| test( 'should return null if no errors', () => { | |
| const state = { | |
| jetpackRemoteInstall: { | |
| errorCode: {}, | |
| }, | |
| }; | |
| expect( getJetpackRemoteInstallErrorCode( state, url ) ).toBeNull(); | |
| } ); | |
| test( 'should return any existing error', () => { | |
| const state = { | |
| jetpackRemoteInstall: { | |
| errorCode: { | |
| [ url ]: 'SOME_ERROR', | |
| }, | |
| }, | |
| }; | |
| expect( getJetpackRemoteInstallErrorCode( state, url ) ).toBe( 'SOME_ERROR' ); | |
| } ); | |
| } ); | |