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.only('getHighBits() & getLowBits()', () => { expect(input1.getHighBits()).toEqual(0) expect(input1.getLowBits()).toEqual(5)
it.only( 'can run jsdom (at least one of "E2E_FILE" or "E2E_URL" environment variables must be provided)', () => { expect( new Error("This isn't the error you are looking for.") ).to.be.undefined(); } );
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.only('can run jsdom (at least one of "E2E_FILE" or "E2E_URL" environment variables must be provided)', () => { expect( new Error("This isn't the error you are looking for.") ).toBeUndefined(); });
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('renders without crashing', () => { const {container} = render(<App />); expect(container).toMatchSnapshot(); });
describe('Input integrate Test', () => { test.each(loginEntries)('check combination for %s', async (loginEntry) => { render(<LoginForm />);
describe('NavBar', () => { const setup = (component) => ( render( <Router> {component} </Router> ) ) test.each(links)( "Check if Nav Bar have %s link.", (link) => { setup(<NavBar />); const linkDom = screen.getByText(link.text); expect(linkDom).toHaveAttribute("href", link.location); } ); test('Check if have logo and link to home page', () => { setup(<NavBar />); const logoDom = screen.getByTestId(/company-logo/); expect(logoDom).toHaveAttribute("href", "/"); expect(screen.getByAltText(/Company Logo/)).toBeInTheDocument(); }); })
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.only('should match elixir did test case', () => { const sk1 = '0x3E0F9A313300226D51E33D5D98A126E86396956122E97E32D31CEE2277380B83FF47B3022FA503EAA1E9FA4B20FA8B16694EA56096F3A2E9109714062B3486D9'; // prettier-ignore expect(fromSecretKey(sk1)).toEqual('z1ioGHFYiEemfLa3hQjk4JTwWTQPu1g2YxP'); expect(fromSecretKey(sk1, { role: types.RoleType.ROLE_NODE })).toEqual('z89nF4GRYvgw5mqk8NqVVC7NeZLWKbcbQY7V'); expect(fromSecretKey(sk1, { role: types.RoleType.ROLE_VALIDATOR })).toEqual('zyt2vg6n8424c9xdXLGj1g27finM77ZN5KQL'); const pk1 = '0xFF47B3022FA503EAA1E9FA4B20FA8B16694EA56096F3A2E9109714062B3486D9'; expect(fromPublicKey(pk1)).toEqual('z1ioGHFYiEemfLa3hQjk4JTwWTQPu1g2YxP'); expect(fromPublicKey(pk1, { role: types.RoleType.ROLE_NODE })).toEqual('z89nF4GRYvgw5mqk8NqVVC7NeZLWKbcbQY7V'); expect(fromPublicKey(pk1, { role: types.RoleType.ROLE_VALIDATOR })).toEqual('zyt2vg6n8424c9xdXLGj1g27finM77ZN5KQL'); // const hash1 = '0xD1B287B1ACB71A980568C99A3AB32A8ED1D9C1BB'; // expect(fromPublicKeyHash(hash1)).toEqual('z1ioGHFYiEemfLa3hQjk4JTwWTQPu1g2YxP'); // expect(fromPublicKeyHash(hash1, { role: types.RoleType.ROLE_NODE })).toEqual('z89nF4GRYvgw5mqk8NqVVC7NeZLWKbcbQY7V'); // expect(fromPublicKeyHash(hash1, { role: types.RoleType.ROLE_VALIDATOR })).toEqual('zyt2vg6n8424c9xdXLGj1g27finM77ZN5KQL'); expect( fromSecretKey('0x26954E19E8781905E2CF91A18AE4F36A954C142176EE1BC27C2635520C49BC55', { pk: types.KeyType.SECP256K1, }) ).toEqual('z1Ee1H8g248HqroacmEnZzMYgbhjz1Z2WSvv'); expect(isValid('did:abt:z1muQ3xqHQK2uiACHyChikobsiY5kLqtShA')).toEqual(true); expect(isValid('z1muQ3xqHQK2uiACHyChikobsiY5kLqtShA')).toEqual(true); expect(isValid('z2muQ3xqHQK2uiACHyChikobsiY5kLqtShA')).toEqual(false); expect(isValid('z1muQ3xqHQK2uiACHyChikobsiY5kLqtSha')).toEqual(false); });
describe('Input validate', () => { test.each(entries)('test with %s entry', async (entry) => { render(<SignupForm />);
}); test.only('should verify tx and account dynamic', async () => { const wallet = ForgeSDK.Wallet.fromRandom(); const chainId = 'zinc-2019-05-17';
it.only( 'can run jsdom (at least one of "E2E_FILE" or "E2E_URL" environment variables must be provided)', () => { expect( new Error("This isn't the error you are looking for.") ).to.be.undefined(); } );