UNPKG

@public-ui/components

Version:

Contains all web components that belong to KoliBri - The accessible HTML-Standard.

23 lines (22 loc) 1.06 kB
/*! * KoliBri - The accessible HTML-Standard */ import { h } from "@stencil/core"; import { renderFunctionalComponentToSpecPage } from "../../../utils/testing"; import SuggestionsFc from "../Suggestions"; describe('SuggestionsFc', () => { it('should render correctly', async () => { var _a; const page = await renderFunctionalComponentToSpecPage(() => h(SuggestionsFc, { id: "test-id", suggestions: [] })); expect(page.root).toMatchSnapshot(); expect((_a = page.root) === null || _a === void 0 ? void 0 : _a.tagName).toBe('DATALIST'); }); it('should render with suggestions', async () => { var _a; const suggestions = ['Option 1', 'Option 2']; const page = await renderFunctionalComponentToSpecPage(() => h(SuggestionsFc, { id: "test-id", suggestions: suggestions })); expect(page.root).toMatchSnapshot(); expect((_a = page.root) === null || _a === void 0 ? void 0 : _a.getElementsByTagName('option')).toHaveLength(2); }); }); //# sourceMappingURL=snapshot.test.js.map