File size: 727 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
26
27
28
29
import { COMMENTS_QUERY_UPDATE } from 'calypso/state/action-types';
import { updateCommentsQuery } from 'calypso/state/comments/ui/actions';

describe( 'actions', () => {
	describe( '#updateCommentsQuery()', () => {
		test( 'should return an update comments pagination action', () => {
			const siteId = 12345678;
			const postId = 1234;
			const comments = [ { ID: 1 }, { ID: 2 }, { ID: 3 }, { ID: 4 }, { ID: 5 } ];
			const query = {
				order: 'DESC',
				page: 1,
				postId: postId,
				search: 'foo',
				status: 'all',
			};

			const action = updateCommentsQuery( siteId, comments, query );

			expect( action ).toEqual( {
				type: COMMENTS_QUERY_UPDATE,
				siteId,
				comments,
				query,
			} );
		} );
	} );
} );