File size: 581 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
import deepFreeze from 'deep-freeze';
import { ACCOUNT_CLOSE_SUCCESS } from 'calypso/state/action-types';
import { isClosed } from '../reducer';

describe( 'reducer', () => {
	describe( '#isClosed()', () => {
		test( 'should default to false', () => {
			const state = isClosed( undefined, {} );
			expect( state ).toEqual( false );
		} );

		test( 'should update for a successful account closure', () => {
			const original = deepFreeze( {} );

			const state = isClosed( original, {
				type: ACCOUNT_CLOSE_SUCCESS,
			} );

			expect( state ).toEqual( true );
		} );
	} );
} );