react-code-dataset / wp-calypso /client /state /selectors /test /get-jetpack-remote-install-error-code.js
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
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' );
} );
} );