File size: 661 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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' );
	} );
} );