Sha256: 9e690f6ec02a891a25c4e6871a090078268e42d0b3c5a710ec62487ad8204947
Contents?: true
Size: 1.25 KB
Versions: 4
Compression:
Stored size: 1.25 KB
Contents
import React from 'react'; import { range } from 'lodash'; import Query from 'hippo/models/query'; import { Snapshot } from 'hippo/testing/screens'; import RecordFinder from 'hippo/components/record-finder'; import { Container } from '../test-models'; jest.mock('hippo/models/sync'); import { FormState, stringValue } from 'hippo/components/form'; describe("RecordFinder Component", () => { let query; let props; let formState; beforeEach(() => { formState = new FormState(); query = new Query({ src: Container, fields: [ { id: 'id', visible: false, queryable: false }, { id: 'computed', title: 'White?', loadable: false }, { id: 'name' }, { id: 'location' }, ], }); props = { onRecordFound: jest.fn(), name: 'name', recordsTitle: 'Foos', formState, query, }; range(0, 5).forEach( i => query.results.rows.push([i, `name ${i}`, `location ${i}`]), ); }); it('renders', () => { const finder = mount( <RecordFinder {...props} />, ); expect(finder).toHaveRendered('TextInput'); }); });
Version data entries
4 entries across 4 versions & 1 rubygems