const testIfKafkaVersion = (version, versionComparator) => { const scopedTest = (description, callback, testFn = test) => { return versionComparator(semver.coerce(process.env.KAFKA_VERSION), semver.coerce(version)) ? testFn(description, callback) : test.skip(description, callback) } scopedTest.only = (description, callback) => scopedTest(description, callback, test.only) return scopedTest }
it.skip('emits request queue size events', async () => { const cluster = createCluster({ instrumentationEmitter: emitter,
it.skip('requests are cached as people enter the viewport', async () => { server.createList('person', 30); const cachedRequests = []; const addAll = jest.fn(requests => cachedRequests.push(requests)); const matchAll = jest.fn(() => []); await renderWithMockedCache(addAll, matchAll); expect(cachedRequests.length).toBe(0); await fireEvent.scroll(window); await wait(() => isScrolledToBottom); expect(cachedRequests.length).toBe(30); });
it.skip('renders without crashing', () => { const {container} = render(<App />); expect(container).toMatchSnapshot(); });
it.skip('weather & forecast requests are cached for people', async () => { let person = server.create('person'); const addAll = jest.fn(); const matchAll = jest.fn(() => []); await renderWithMockedCache(addAll, matchAll); await fireEvent.scroll(window); await wait(() => isScrolledToBottom); expect(addAll).toHaveBeenCalledWith([ `/api/weather?lat=${person.lat}&long=${person.long}`, `/api/forecast?lat=${person.lat}&long=${person.long}` ]); });
it.skip('total count of cached people displayed', async () => { server.create('person'); const container = await renderWithMockedCache( jest.fn(), jest.fn(() => Promise.resolve([])) ); expect( queryByTestId(container, 'total-cache-count') ).not.toBeInTheDocument(); await fireEvent.scroll(window); await wait(() => isScrolledToBottom); expect(queryByTestId(container, 'total-cache-count')).toHaveTextContent(1); });
}); test.skip("renders table when there are results", async () => {
}); test.skip("calls onSubmit callback with serialized form data", () => { const { getByTestId } = render( <FormModal show={true} onHide={onHide} onSubmit={onSubmit} />