import React from 'react'; import { first, map, find, range } from 'lodash'; import { autorun } from 'mobx'; import Sync from 'hippo/models/sync'; import Query from 'hippo/models/query'; import DataTable from 'hippo/components/data-table'; import { Container } from '../test-models'; jest.mock('hippo/models/sync'); describe("DataTable Component", () => { let query; beforeEach(() => { query = new Query({ src: Container, fields: [ { id: 'id', visible: false, queryable: false }, { id: 'computed', title: 'White?', loadable: false }, { id: 'name' }, { id: 'location' }, ], }); range(0, 5).forEach( i => query.results.rows.push([i, `name ${i}`, `location ${i}`]), ); }); it('can be edited', () => { const Editor = () =>