UNPKG

@zohodesk/components

Version:

Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development

36 lines 1.19 kB
import React from 'react'; import { render } from '@testing-library/react'; import MultiSelect from "../MultiSelect"; const testData = ['text1', 'text2', 'text3', 'text4', 'text5', 'text6', 'text7', 'text8', 'text9', 'text10']; const testSelectedData = ['text1', 'text2', 'text3']; describe('MultiSelect', () => { test('rendering the defult props', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(MultiSelect, null)); expect(asFragment()).toMatchSnapshot(); }); test('rendering with limit feature', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(MultiSelect, { valueField: "id", textField: "text", options: testData, selectedOptions: testSelectedData, needSelectAll: true, selectAllText: "Select All", placeHolder: "Select Text", i18nKeys: { clearText: 'Clear Selected Items', loadingText: 'Fetching...', emptyText: 'No Options .', noMoreText: 'No More Options .', searchEmptyText: 'No Matches Found .' }, needResponsive: true, limit: 3 })); expect(asFragment()).toMatchSnapshot(); }); });