UNPKG

wix-style-react

Version:
309 lines (271 loc) • 5.67 kB
import React from 'react'; import AllComponents from './all-components'; var Popover = AllComponents.Popover, Dropdown = AllComponents.Dropdown, MultiSelect = AllComponents.MultiSelect, AutoComplete = AllComponents.AutoComplete, Input = AllComponents.Input, InputArea = AllComponents.InputArea, Label = AllComponents.Label, RichTextArea = AllComponents.RichTextArea, Notification = AllComponents.Notification, FloatingHelper = AllComponents.FloatingHelper; /* * This file exports object with config for components. * It is used for automated teskit smoke tests * * { [component.displayName]: ComponentDefinition } * * [component.displayName] = { * // hook function to be called before tests begin * beforeAllHook?: function; * * // hook function to be called after tests end * afterAllHook?: function; * * // set required props, if any * props?: object; * } */ export default { ColorPicker: { props: { value: '#000', onChange: function onChange() {}, onCancel: function onCancel() {}, onConfirm: function onConfirm() {} } }, DropdownComposite: { props: { children: React.createElement(Dropdown, null) } }, MultiSelectComposite: { props: { children: React.createElement(MultiSelect, null) } }, AutoCompleteComposite: { props: { children: [React.createElement(AutoComplete, { key: 1 })] } }, ButtonHeader: { // it's actually Card.ButtonHeader, should be deprecated props: { buttonTitle: 'Click me', subtitle: 'Header Subtitle', title: 'Header Title', buttonOnClick: function buttonOnClick() {} } }, Popover: { props: { children: [React.createElement( Popover.Element, null, React.createElement( 'div', null, 'I am the trigger!' ) ), React.createElement( Popover.Content, null, React.createElement( 'div', null, 'I am the content!' ) )] } }, FloatingHelper: { props: { content: React.createElement(FloatingHelper.Content, { title: 'title', body: 'body' }), target: React.createElement( 'div', null, 'target' ), placement: 'left' } }, RichTextArea: { beforeAllHook: function beforeAllHook() { return window.getSelection = function () { return {}; }; } }, RichTextAreaComposite: { props: { children: [React.createElement( Label, { key: '0' }, 'Label text' ), React.createElement(RichTextArea, { key: '1' })] } }, Range: { props: { children: [React.createElement(Input, { key: '0' }), React.createElement(Input, { key: '1' })] } }, ButtonLayout: { props: { children: React.createElement( 'div', null, 'abc' ) } }, Tag: { props: { useOldMargins: false, id: 'hello', children: 'a' } }, Badge: { props: { children: 'hello' } }, Button: { props: { upgrade: true } }, ImageViewer: { props: { imageUrl: '' } }, FormField: { props: { children: React.createElement('div', null) } }, BadgeSelect: { props: { options: [{ id: '0', skin: 'general', text: 'general' }], selectedId: '0' } }, CalendarPanel: { props: { onChange: function onChange() {} } }, Breadcrumbs: { props: { items: [{ id: 0, value: 'Option 1' }, { id: 1, value: 'Option 2' }] } }, Calendar: { props: { onChange: function onChange() {} } }, CalendarPanelFooter: { props: { primaryActionLabel: 'Submit', secondaryActionLabel: 'Cancel', primaryActionDisabled: false, primaryActionOnClick: function primaryActionOnClick() { return null; }, secondaryActionOnClick: function secondaryActionOnClick() { return null; }, dateToString: function dateToString() { return 'a string'; } } }, DataTable: { props: { data: [{ a: 'value 1', b: 'value 2' }], columns: [{ title: 'A', render: function render(row) { return row.a; } }] } }, Slider: { props: { onChange: function onChange() {} } }, Selector: { props: { id: 1, title: 'title' } }, StatsWidget: { props: { title: 'test title' } }, Table: { props: { data: [{ a: 'value 1', b: 'value 2' }], columns: [{ title: 'A', render: function render(row) { return row.a; } }] } }, TextField: { props: { children: React.createElement(Input, null) } }, TextArea: { props: { children: React.createElement(InputArea, null) } }, Tabs: { props: { items: [] } }, Modal: { props: { isOpen: false } }, Notification: { props: { children: [React.createElement( Notification.TextLabel, { key: '0' }, 'label' ), React.createElement(Notification.CloseButton, { key: '1' })] } }, DatePicker: { props: { onChange: function onChange() {} } }, ModalSelectorLayout: { props: { dataSource: function dataSource() { return Promise.resolve({ items: [], totalCount: 0 }); } } }, Proportion: { props: { children: 'test' } }, Box: { props: { children: React.createElement('div', null) } } };