| Total Complexity | 7 |
| Complexity/F | 1 |
| Lines of Code | 52 |
| Function Count | 7 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { |
||
| 2 | getOrder, |
||
| 3 | getOrderColumn, |
||
| 4 | getPage, |
||
| 5 | getPosts, |
||
| 6 | getRowsPerPage, |
||
| 7 | getSelectedPosts |
||
| 8 | } from '../selectors' |
||
| 9 | |||
| 10 | describe('Posts selectors', () => { |
||
| 11 | it('getOrder', function() { |
||
| 12 | const posts = { |
||
| 13 | order: 'asc' |
||
| 14 | } |
||
| 15 | expect(getOrder({ posts })).toEqual('asc') |
||
| 16 | }) |
||
| 17 | |||
| 18 | it('getOrderColumn', function() { |
||
| 19 | const posts = { |
||
| 20 | orderColumn: 'title' |
||
| 21 | } |
||
| 22 | expect(getOrderColumn({ posts })).toEqual('title') |
||
| 23 | }) |
||
| 24 | |||
| 25 | it('getPage', function() { |
||
| 26 | const posts = { |
||
| 27 | page: 0 |
||
| 28 | } |
||
| 29 | expect(getPage({ posts })).toEqual(0) |
||
| 30 | }) |
||
| 31 | |||
| 32 | it('getPosts', function() { |
||
| 33 | const posts = { |
||
| 34 | posts: [] |
||
| 35 | } |
||
| 36 | expect(getPosts({ posts })).toEqual([]) |
||
| 37 | }) |
||
| 38 | |||
| 39 | it('getRowsPerPage', function() { |
||
| 40 | const posts = { |
||
| 41 | rowsPerPage: 15 |
||
| 42 | } |
||
| 43 | expect(getRowsPerPage({ posts })).toEqual(15) |
||
| 44 | }) |
||
| 45 | |||
| 46 | it('getSelectedPosts', function() { |
||
| 47 | const posts = { |
||
| 48 | selectedPosts: ['a', 'b'] |
||
| 49 | } |
||
| 50 | expect(getSelectedPosts({ posts })).toEqual(['a', 'b']) |
||
| 51 | }) |
||
| 52 | }) |
||
| 53 |