redux-dux
Version:
``` npm i --save redux-dux ```
23 lines (19 loc) • 576 B
JavaScript
/* globals
expect,
test
*/
import { createStore } from '../src';
import { ThickGrid } from './thickGrid';
test('thick grid', () => {
const store = createStore(s => s);
const grid = ThickGrid();
grid.setRows([{ a: 1 }, { b: 2 }], 1000);
expect(grid.selectors.rows(store.getState())).toEqual([{ a: 1 }, { b: 2 }]);
expect(grid.selectors.total(store.getState())).toEqual(1000);
grid.setFilter([{ field: '', value: '' }]);
grid.last();
expect(grid.selectors.query(store.getState())).toEqual({
filter: [{ field: '', value: '' }],
page: 20
});
});