UNPKG

@findify/react-components

Version:
48 lines (46 loc) 1.25 kB
import Tip from "./view"; var theme = { "tip": "findify-components-autocomplete--tip__tip", "highlight": "findify-components-autocomplete--tip__highlight" }; import { shallow } from 'enzyme'; import { jsx as _jsx } from "react/jsx-runtime"; var config = { get: function get() { return 'Press Enter to search'; } }; var createSuggestionMock = function createSuggestionMock(size, value) { return { getIn: function getIn() { return value; }, size: size }; }; describe('Tip', function () { it('renders correctly', function () { expect(shallow( /*#__PURE__*/_jsx(Tip, { className: "test", title: "Press Enter to search", theme: theme, suggestions: createSuggestionMock(0), getSuggestionProps: function getSuggestionProps() { return { onClick: function onClick() {} }; } }))).toMatchSnapshot(); expect(shallow( /*#__PURE__*/_jsx(Tip, { className: "test", suggestions: createSuggestionMock(2, 'evangelion'), title: "Press Enter to search", theme: theme, getSuggestionProps: function getSuggestionProps() { return { onClick: function onClick() {} }; } }))).toMatchSnapshot(); }); });