@evoke-platform/ui-components 1.0.0-dev.183 → 1.0.0-dev.185

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/published/components/core/Autocomplete/Autocomplete.js +4 -4
  2. package/dist/published/components/core/Autocomplete/Autocomplete.test.d.ts +1 -0
  3. package/dist/published/components/core/Autocomplete/Autocomplete.test.js +11 -0
  4. package/dist/published/components/core/TextField/TextField.js +4 -5
  5. package/dist/published/components/core/TextField/TextField.test.js +9 -9
  6. package/dist/published/components/custom/FormField/AddressFieldComponent/AddressFieldComponent.test.d.ts +1 -0
  7. package/dist/published/components/custom/FormField/AddressFieldComponent/AddressFieldComponent.test.js +89 -0
  8. package/dist/published/components/custom/FormField/AddressFieldComponent/addressFieldComponent.d.ts +3 -1
  9. package/dist/published/components/custom/FormField/AddressFieldComponent/addressFieldComponent.js +6 -12
  10. package/dist/published/components/custom/FormField/BooleanSelect/BooleanSelect.d.ts +3 -1
  11. package/dist/published/components/custom/FormField/BooleanSelect/BooleanSelect.js +2 -3
  12. package/dist/published/components/custom/FormField/BooleanSelect/BooleanSelect.test.d.ts +1 -0
  13. package/dist/published/components/custom/FormField/BooleanSelect/BooleanSelect.test.js +32 -0
  14. package/dist/published/components/custom/FormField/DatePickerSelect/DatePickerSelect.d.ts +3 -1
  15. package/dist/published/components/custom/FormField/DatePickerSelect/DatePickerSelect.js +2 -3
  16. package/dist/published/components/custom/FormField/DatePickerSelect/DatePickerSelect.test.d.ts +1 -0
  17. package/dist/published/components/custom/FormField/DatePickerSelect/DatePickerSelect.test.js +73 -0
  18. package/dist/published/components/custom/FormField/FileUpload/FileUpload.d.ts +3 -1
  19. package/dist/published/components/custom/FormField/FileUpload/FileUpload.js +4 -5
  20. package/dist/published/components/custom/FormField/FormField.d.ts +1 -0
  21. package/dist/published/components/custom/FormField/FormField.js +2 -3
  22. package/dist/published/components/custom/FormField/InputFieldComponent/InputFieldComponent.d.ts +3 -1
  23. package/dist/published/components/custom/FormField/InputFieldComponent/InputFieldComponent.js +3 -4
  24. package/dist/published/components/custom/FormField/InputFieldComponent/InputFieldComponent.test.d.ts +1 -0
  25. package/dist/published/components/custom/FormField/InputFieldComponent/InputFieldComponent.test.js +52 -0
  26. package/dist/published/components/custom/FormField/Select/Select.d.ts +3 -1
  27. package/dist/published/components/custom/FormField/Select/Select.js +3 -4
  28. package/dist/published/components/custom/FormField/Select/Select.test.d.ts +1 -0
  29. package/dist/published/components/custom/FormField/Select/Select.test.js +68 -0
  30. package/dist/published/components/custom/FormField/TimePickerSelect/TimePickerSelect.d.ts +3 -1
  31. package/dist/published/components/custom/FormField/TimePickerSelect/TimePickerSelect.js +3 -4
  32. package/dist/published/stories/MenuBar.stories.js +1 -1
  33. package/dist/published/stories/TimePickerSelect.stories.d.ts +6 -2
  34. package/package.json +9 -2
@@ -5,7 +5,7 @@ import UIThemeProvider from '../../../theme';
5
5
  import FieldError from '../FieldError';
6
6
  import Typography from '../Typography';
7
7
  const Autocomplete = (props) => {
8
- var _a, _b, _c, _d, _e;
8
+ var _a, _b, _c, _d;
9
9
  const sortedOptions = props.sortBy !== 'NONE'
10
10
  ? props.options.map((option) => {
11
11
  var _a, _b;
@@ -28,7 +28,7 @@ const Autocomplete = (props) => {
28
28
  }
29
29
  if (!!props.label && props.labelPlacement === 'outside-top') {
30
30
  return (React.createElement(UIThemeProvider, null,
31
- React.createElement(InputLabel, { "data-testid": "label-outside", htmlFor: (_b = (_a = props.label) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '', sx: { paddingBottom: '0px', fontSize: '14px' } }, (_c = props.label) !== null && _c !== void 0 ? _c : '',
31
+ React.createElement(InputLabel, { htmlFor: (_a = props.id) !== null && _a !== void 0 ? _a : '', sx: { paddingBottom: '0px', fontSize: '14px' } }, (_b = props.label) !== null && _b !== void 0 ? _b : '',
32
32
  ' ',
33
33
  props.required ? (React.createElement(Typography, { sx: { color: 'red', fontSize: '14px' }, component: 'span' }, "*")) : null),
34
34
  props.instructionText && (React.createElement(Typography, { fontSize: '10px', lineHeight: '14px' }, props.instructionText)),
@@ -36,7 +36,7 @@ const Autocomplete = (props) => {
36
36
  border: props.readOnly ? 'none' : 'auto',
37
37
  }, '& .MuiInputBase-input.Mui-disabled': {
38
38
  WebkitTextFillColor: props.readOnly ? 'black' : 'auto',
39
- }, backgroundColor: props.readOnly ? '#f4f6f8' : 'auto', marginTop: '3px', borderRadius: '8px' }, props.sx), options: sortedOptions, popupIcon: ((_d = props.popupIcon) !== null && _d !== void 0 ? _d : (props.readOnly || props.disabled)) ? null : React.createElement(ExpandMore, null) })),
39
+ }, backgroundColor: props.readOnly ? '#f4f6f8' : 'auto', marginTop: '3px', borderRadius: '8px' }, props.sx), options: sortedOptions, popupIcon: ((_c = props.popupIcon) !== null && _c !== void 0 ? _c : (props.readOnly || props.disabled)) ? null : React.createElement(ExpandMore, null) })),
40
40
  props.error && React.createElement(FieldError, { required: props.required, label: props.errorMessage })));
41
41
  }
42
42
  else {
@@ -45,7 +45,7 @@ const Autocomplete = (props) => {
45
45
  border: props.readOnly ? 'none' : 'auto',
46
46
  }, '& .MuiInputBase-input.Mui-disabled': {
47
47
  WebkitTextFillColor: props.readOnly ? 'black' : 'auto',
48
- }, backgroundColor: props.readOnly ? '#f4f6f8' : 'auto', borderRadius: '8px' }, props.sx), options: sortedOptions, popupIcon: ((_e = props.popupIcon) !== null && _e !== void 0 ? _e : (props.readOnly || props.disabled)) ? null : React.createElement(ExpandMore, null) })),
48
+ }, backgroundColor: props.readOnly ? '#f4f6f8' : 'auto', borderRadius: '8px' }, props.sx), options: sortedOptions, popupIcon: ((_d = props.popupIcon) !== null && _d !== void 0 ? _d : (props.readOnly || props.disabled)) ? null : React.createElement(ExpandMore, null) })),
49
49
  props.error && React.createElement(FieldError, { required: props.required, label: props.errorMessage })));
50
50
  }
51
51
  };
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom/extend-expect';
@@ -0,0 +1,11 @@
1
+ import '@testing-library/jest-dom/extend-expect';
2
+ import { render, screen } from '@testing-library/react';
3
+ import React from 'react';
4
+ import Autocomplete from './Autocomplete';
5
+ import TextField from '../TextField';
6
+ const renderInput = (params) => React.createElement(TextField, Object.assign({}, params));
7
+ const options = [];
8
+ test('renders with label outside outline', () => {
9
+ render(React.createElement(Autocomplete, { id: "testinput", labelPlacement: "outside-top", label: "Title", renderInput: renderInput, options: options }));
10
+ screen.getByRole('combobox', { name: 'Title' });
11
+ });
@@ -4,8 +4,7 @@ import UIThemeProvider from '../../../theme';
4
4
  import FieldError from '../FieldError';
5
5
  import Typography from '../Typography';
6
6
  const TextField = (props) => {
7
- var _a;
8
- const { variant, label, labelPlacement, readOnly, required, error, instructionText, errorMessage } = props;
7
+ const { id, variant, label, labelPlacement, readOnly, required, error, instructionText, errorMessage } = props;
9
8
  const readOnlyStyles = {
10
9
  '.MuiOutlinedInput-root': {
11
10
  paddingRight: '5px',
@@ -20,14 +19,14 @@ const TextField = (props) => {
20
19
  '& fieldset': { borderColor: 'transparent', borderRadius: '8px' },
21
20
  };
22
21
  return (React.createElement(UIThemeProvider, null, variant === 'outlined' && !!label && labelPlacement === 'outside-top' ? (React.createElement(React.Fragment, null,
23
- React.createElement(InputLabel, { "data-testid": "label-outside", htmlFor: (_a = label === null || label === void 0 ? void 0 : label.toString()) !== null && _a !== void 0 ? _a : '', sx: { paddingBottom: instructionText ? '0px' : '3px', fontSize: '14px' } }, label !== null && label !== void 0 ? label : '',
22
+ React.createElement(InputLabel, { htmlFor: id !== null && id !== void 0 ? id : '', sx: { paddingBottom: instructionText ? '0px' : '3px', fontSize: '14px' } }, label !== null && label !== void 0 ? label : '',
24
23
  ' ',
25
24
  props.required ? (React.createElement(Typography, { sx: { color: 'red', fontSize: '14px' }, component: 'span' }, "*")) : null),
26
25
  instructionText && React.createElement(Typography, { variant: 'caption' }, instructionText),
27
- React.createElement(MUITextField, Object.assign({}, props, { label: null, inputProps: { readOnly: readOnly, 'aria-readonly': !!readOnly }, sx: readOnly
26
+ React.createElement(MUITextField, Object.assign({}, props, { label: null, inputProps: { readOnly: readOnly, 'aria-readonly': !!readOnly, 'data-testid': 'label-outside' }, sx: readOnly
28
27
  ? Object.assign(Object.assign({}, readOnlyStyles), props.sx) : Object.assign({ '& fieldset': { borderRadius: '8px' } }, props.sx) })),
29
28
  error && React.createElement(FieldError, { required: required, label: errorMessage }))) : (React.createElement(React.Fragment, null,
30
- React.createElement(MUITextField, Object.assign({ "data-testid": "label-inside", inputProps: { readOnly: readOnly, 'aria-readonly': !!readOnly } }, props, { sx: readOnly
29
+ React.createElement(MUITextField, Object.assign({ inputProps: { readOnly: readOnly, 'aria-readonly': !!readOnly, 'data-testid': 'label-inside' } }, props, { sx: readOnly
31
30
  ? Object.assign(Object.assign({}, readOnlyStyles), props.sx) : Object.assign({ '& fieldset': { borderRadius: '8px' } }, props.sx) })),
32
31
  error && React.createElement(FieldError, { required: required, label: errorMessage })))));
33
32
  };
@@ -3,18 +3,18 @@ import React from 'react';
3
3
  import { render, screen } from '@testing-library/react';
4
4
  import TextField from './index';
5
5
  test('render TextField and check for data-testid === label-outside when labelPlacement === outside-top && variant === outlined', () => {
6
- render(React.createElement(TextField, { labelPlacement: "outside-top", variant: "outlined", label: "Title" }));
7
- const label = screen.getByTestId('label-outside');
8
- expect(label).toBeInTheDocument();
6
+ render(React.createElement(TextField, { id: "testinput", labelPlacement: "outside-top", variant: "outlined", label: "Title" }));
7
+ const textField = screen.getByRole('textbox', { name: 'Title' });
8
+ expect(textField).toHaveAttribute('data-testid', 'label-outside');
9
9
  });
10
10
  test('render TextField and check for data-testid === label-inside when labelPlacement === outside-top && variant !== outlined using data-testid', () => {
11
- render(React.createElement(TextField, { labelPlacement: "outside-top", label: "Title2" }));
12
- const label = screen.getByTestId('label-inside');
13
- expect(label).toBeInTheDocument();
11
+ render(React.createElement(TextField, { id: "testinput", labelPlacement: "outside-top", label: "Title2" }));
12
+ const textField = screen.getByRole('textbox', { name: 'Title2' });
13
+ expect(textField).toHaveAttribute('data-testid', 'label-inside');
14
14
  });
15
15
  test('render TextField and check for data-testid === label-inside when labelPlacement === undefined', () => {
16
- render(React.createElement(TextField, { label: "Title3" }));
17
- const label = screen.getByTestId('label-inside');
18
- expect(label).toBeInTheDocument();
16
+ render(React.createElement(TextField, { id: "testinput", label: "Title3" }));
17
+ const textField = screen.getByRole('textbox', { name: 'Title3' });
18
+ expect(textField).toHaveAttribute('data-testid', 'label-inside');
19
19
  });
20
20
  // TODO Add a test case to check if the label is not present outside the TextField when the labelPlacement is undefined or not equal to outside-top
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom/extend-expect';
@@ -0,0 +1,89 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import '@testing-library/jest-dom/extend-expect';
11
+ import React from 'react';
12
+ import { render, screen } from '@testing-library/react';
13
+ import { userEvent } from '@testing-library/user-event';
14
+ import AddressFieldComponent from './addressFieldComponent';
15
+ // Right now an object property is required for this to function, but eventually this should go
16
+ // away.
17
+ const addressProperty = {
18
+ id: 'addressLine1',
19
+ name: 'Line 1',
20
+ type: 'text',
21
+ };
22
+ test('displays matching addresses', () => __awaiter(void 0, void 0, void 0, function* () {
23
+ const user = userEvent.setup();
24
+ const queryAddresses = (search) => __awaiter(void 0, void 0, void 0, function* () {
25
+ return [
26
+ {
27
+ address: {
28
+ line1: '1234 Main Street',
29
+ city: 'Columbia',
30
+ county: 'Howard',
31
+ state: 'Maryland',
32
+ zipCode: '21046',
33
+ },
34
+ },
35
+ {
36
+ address: {
37
+ line1: '12345 Main Avenue',
38
+ city: 'Columbia',
39
+ county: 'Howard',
40
+ state: 'Maryland',
41
+ zipCode: '21046',
42
+ },
43
+ },
44
+ ];
45
+ });
46
+ render(React.createElement(AddressFieldComponent, { id: "addressSearch", property: addressProperty, onChange: () => { }, queryAddresses: queryAddresses }));
47
+ const addressField = screen.getByRole('searchbox');
48
+ yield user.type(addressField, '1234 Main');
49
+ yield screen.findByRole('menuitem', { name: /1234 Main Street/ });
50
+ yield screen.findByRole('menuitem', { name: /12345 Main Avenue/ });
51
+ }));
52
+ test('returns manually typed address', () => __awaiter(void 0, void 0, void 0, function* () {
53
+ const user = userEvent.setup();
54
+ const onChangeMock = jest.fn((name, value, property, unused) => { });
55
+ render(React.createElement(AddressFieldComponent, { id: "addressSearch", property: addressProperty, onChange: onChangeMock }));
56
+ const addressField = screen.getByRole('searchbox');
57
+ yield user.type(addressField, '1234 Main St');
58
+ expect(onChangeMock).toBeCalledTimes(12);
59
+ expect(onChangeMock).lastCalledWith('addressLine1', '1234 Main St', addressProperty, undefined);
60
+ }));
61
+ test('returns selected search result', () => __awaiter(void 0, void 0, void 0, function* () {
62
+ const user = userEvent.setup();
63
+ const onChangeMock = jest.fn((name, value, property, unused) => { });
64
+ const queryAddresses = (search) => __awaiter(void 0, void 0, void 0, function* () {
65
+ return [
66
+ {
67
+ address: {
68
+ line1: '1234 Main Street',
69
+ city: 'Columbia',
70
+ county: 'Howard',
71
+ state: 'Maryland',
72
+ zipCode: '21046',
73
+ },
74
+ },
75
+ ];
76
+ });
77
+ render(React.createElement(AddressFieldComponent, { id: "addressSearch", property: addressProperty, onChange: onChangeMock, queryAddresses: queryAddresses }));
78
+ const addressField = screen.getByRole('searchbox');
79
+ yield user.type(addressField, '1234 Main');
80
+ const searchResult = yield screen.findByRole('menuitem', { name: /1234 Main Street/ });
81
+ yield user.click(searchResult);
82
+ expect(onChangeMock).lastCalledWith('addressLine1', {
83
+ line1: '1234 Main Street',
84
+ city: 'Columbia',
85
+ county: 'Howard',
86
+ state: 'Maryland',
87
+ zipCode: '21046',
88
+ }, addressProperty, undefined);
89
+ }));
@@ -1,4 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FormFieldProps } from '../FormField';
3
- declare const AddressFieldComponent: (props: FormFieldProps) => JSX.Element;
3
+ declare const AddressFieldComponent: (props: FormFieldProps & {
4
+ id: string;
5
+ }) => JSX.Element;
4
6
  export default AddressFieldComponent;
@@ -2,14 +2,13 @@ import { Popover } from '@mui/material';
2
2
  import React, { useEffect, useState } from 'react';
3
3
  import InputMask from 'react-input-mask';
4
4
  import { CancelOutlined } from '@mui/icons-material';
5
- import { Button, List, ListItem, TextField, Typography } from '../../../core';
5
+ import { Button, List, ListItem, MenuItem, TextField, Typography } from '../../../core';
6
6
  import { Box } from '../../../layout';
7
7
  const AddressFieldComponent = (props) => {
8
- const { property, defaultValue, error, errorMessage, onBlur, readOnly, required, size, placeholder, mask, isMultiLineText, rows, inputMaskPlaceholderChar, queryAddresses, } = props;
8
+ const { id, property, defaultValue, error, errorMessage, onBlur, readOnly, required, size, placeholder, mask, isMultiLineText, rows, inputMaskPlaceholderChar, queryAddresses, } = props;
9
9
  const [value, setValue] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
10
10
  const [selectOptions, setSelectOptions] = useState([]);
11
11
  const [anchorEl, setAnchorEl] = React.useState(null);
12
- const id = property.id;
13
12
  const open = Boolean(anchorEl);
14
13
  const popoverId = open ? `${id}-popover` : undefined;
15
14
  useEffect(() => {
@@ -45,18 +44,18 @@ const AddressFieldComponent = (props) => {
45
44
  return { label, sublabel, value: address.address };
46
45
  }));
47
46
  });
48
- props.onChange(id, inputValue, property, undefined);
47
+ props.onChange(property.id, inputValue, property, undefined);
49
48
  };
50
49
  const handleClick = (option) => {
51
50
  setAnchorEl(null);
52
51
  setValue(option.value.line1);
53
- props.onChange(id, option.value, property, undefined);
52
+ props.onChange(property.id, option.value, property, undefined);
54
53
  };
55
54
  const handleClose = () => {
56
55
  setAnchorEl(null);
57
56
  };
58
57
  return (React.createElement(Box, null,
59
- !mask ? (React.createElement(TextField, { id: id, "aria-describedby": popoverId, onChange: !readOnly ? handleChange : undefined, error: error, errorMessage: errorMessage, value: value, fullWidth: true, onBlur: onBlur, size: size !== null && size !== void 0 ? size : 'medium', placeholder: placeholder, InputProps: {
58
+ !mask ? (React.createElement(TextField, { id: id, onChange: !readOnly ? handleChange : undefined, error: error, errorMessage: errorMessage, value: value, fullWidth: true, onBlur: onBlur, size: size !== null && size !== void 0 ? size : 'medium', placeholder: placeholder, InputProps: {
60
59
  type: 'search',
61
60
  autoComplete: 'off',
62
61
  }, required: required, readOnly: readOnly, multiline: property.type === 'string' && !readOnly && isMultiLineText, rows: isMultiLineText ? (rows ? rows : 3) : undefined })) : (React.createElement(InputMask, { mask: mask, maskChar: inputMaskPlaceholderChar !== null && inputMaskPlaceholderChar !== void 0 ? inputMaskPlaceholderChar : '_', value: value, onChange: !readOnly ? handleChange : undefined, onBlur: onBlur, alwaysShowMask: true }, () => (React.createElement(TextField, { id: id, sx: readOnly
@@ -87,12 +86,7 @@ const AddressFieldComponent = (props) => {
87
86
  } },
88
87
  React.createElement(List, null,
89
88
  selectOptions.map((option) => {
90
- return (React.createElement(ListItem, { onClick: () => handleClick(option), sx: {
91
- '&:hover': {
92
- cursor: 'pointer',
93
- backgroundColor: 'rgba(0, 0, 0, 0.04)',
94
- },
95
- } },
89
+ return (React.createElement(MenuItem, { key: option.label + option.sublabel, onClick: () => handleClick(option) },
96
90
  React.createElement(Box, { sx: {
97
91
  flexGrow: 1,
98
92
  } },
@@ -1,4 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FormFieldProps } from '../FormField';
3
- declare const BooleanSelect: (props: FormFieldProps) => JSX.Element;
3
+ declare const BooleanSelect: (props: FormFieldProps & {
4
+ id: string;
5
+ }) => JSX.Element;
4
6
  export default BooleanSelect;
@@ -2,15 +2,14 @@ import React, { useEffect, useState } from 'react';
2
2
  import { Autocomplete, TextField } from '../../../core';
3
3
  import InputFieldComponent from '../InputFieldComponent/InputFieldComponent';
4
4
  const BooleanSelect = (props) => {
5
- const { property, defaultValue, error, errorMessage, readOnly, size, placeholder, onBlur } = props;
5
+ const { id, property, defaultValue, error, errorMessage, readOnly, size, placeholder, onBlur } = props;
6
6
  const [value, setValue] = useState(defaultValue);
7
- const id = property.id;
8
7
  useEffect(() => {
9
8
  setValue(defaultValue);
10
9
  }, [defaultValue]);
11
10
  const handleChange = (event, selected) => {
12
11
  setValue(selected.label);
13
- props.onChange(id, selected.label, property);
12
+ props.onChange(property.id, selected.label, property);
14
13
  };
15
14
  const booleanOptions = [
16
15
  {
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom/extend-expect';
@@ -0,0 +1,32 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import '@testing-library/jest-dom/extend-expect';
11
+ import React from 'react';
12
+ import { render, screen } from '@testing-library/react';
13
+ import { userEvent } from '@testing-library/user-event';
14
+ import BooleanSelect from './BooleanSelect';
15
+ // Right now an object property is required for this to function, but eventually this should go
16
+ // away.
17
+ const booleanProperty = {
18
+ id: 'theQuestion',
19
+ name: 'Question',
20
+ type: 'boolean',
21
+ };
22
+ test('returns selected option', () => __awaiter(void 0, void 0, void 0, function* () {
23
+ const user = userEvent.setup();
24
+ const onChangeMock = jest.fn((name, value, property) => { });
25
+ render(React.createElement(BooleanSelect, { id: "chooseYesOrNo", property: booleanProperty, onChange: onChangeMock }));
26
+ const inputField = screen.getByRole('combobox');
27
+ yield user.click(inputField);
28
+ const yesOption = yield screen.findByRole('option', { name: 'Yes' });
29
+ yield user.click(yesOption);
30
+ expect(onChangeMock).toBeCalledWith('theQuestion', 'Yes', // ?? why not true/false?
31
+ booleanProperty);
32
+ }));
@@ -1,4 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FormFieldProps } from '../FormField';
3
- declare const DatePickerSelect: (props: FormFieldProps) => JSX.Element;
3
+ declare const DatePickerSelect: (props: FormFieldProps & {
4
+ id: string;
5
+ }) => JSX.Element;
4
6
  export default DatePickerSelect;
@@ -26,15 +26,14 @@ const asMonthDayYearFormat = (date) => {
26
26
  }
27
27
  };
28
28
  const DatePickerSelect = (props) => {
29
- const { property, defaultValue, error, errorMessage, readOnly, required, size, onBlur } = props;
29
+ const { id, property, defaultValue, error, errorMessage, readOnly, required, size, onBlur } = props;
30
30
  const [value, setValue] = useState(asCalendarDate(defaultValue));
31
- const id = property.id;
32
31
  useEffect(() => {
33
32
  setValue(asCalendarDate(defaultValue));
34
33
  }, [defaultValue]);
35
34
  const handleChange = (date) => {
36
35
  setValue(date);
37
- props.onChange(id, date, property);
36
+ props.onChange(property.id, date, property);
38
37
  };
39
38
  return readOnly ? (React.createElement(InputFieldComponent, Object.assign({}, Object.assign(Object.assign({}, props), { defaultValue: asMonthDayYearFormat(value) })))) : (React.createElement(LocalizationProvider, null,
40
39
  React.createElement(DatePicker, { value: value, onChange: handleChange, inputFormat: "MM/dd/yyyy", renderInput: (params) => (React.createElement(TextField, Object.assign({}, params, { id: id, error: error, errorMessage: errorMessage, onBlur: onBlur, fullWidth: true, required: required, sx: { background: 'white', borderRadius: '8px' }, size: size !== null && size !== void 0 ? size : 'medium' }))) })));
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom/extend-expect';
@@ -0,0 +1,73 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import '@testing-library/jest-dom/extend-expect';
11
+ import React from 'react';
12
+ import { render, screen, within } from '@testing-library/react';
13
+ import { userEvent } from '@testing-library/user-event';
14
+ import DatePickerSelect from './DatePickerSelect';
15
+ import { LocalDate, Month } from '@js-joda/core';
16
+ import { InvalidDate } from '../../../../util';
17
+ // Right now an object property is required for this to function, but eventually this should go
18
+ // away.
19
+ const dateProperty = {
20
+ id: 'testDate',
21
+ name: 'Date',
22
+ type: 'date',
23
+ };
24
+ beforeAll(() => {
25
+ // Set specific date for a repeatable test.
26
+ jest.useFakeTimers({
27
+ now: new Date('2024-02-11'),
28
+ // Only want to set current time, don't override timer functions as that will
29
+ // confuse @testing-library.
30
+ doNotFake: [
31
+ 'setImmediate',
32
+ 'clearImmediate',
33
+ 'setTimeout',
34
+ 'clearTimeout',
35
+ 'setInterval',
36
+ 'clearInterval',
37
+ 'nextTick',
38
+ 'queueMicrotask',
39
+ ],
40
+ });
41
+ });
42
+ afterAll(() => {
43
+ jest.useRealTimers();
44
+ });
45
+ test('returns selected date', () => __awaiter(void 0, void 0, void 0, function* () {
46
+ const user = userEvent.setup();
47
+ const onChangeMock = jest.fn((name, value, property) => { });
48
+ render(React.createElement(DatePickerSelect, { id: "pickDate", property: dateProperty, onChange: onChangeMock }));
49
+ const calendarIcon = screen.getByRole('button', { name: /Choose date/i });
50
+ yield user.click(calendarIcon);
51
+ const calendar = yield screen.findByRole('dialog');
52
+ const feb29 = yield within(calendar).findByRole('gridcell', { name: '29' });
53
+ yield user.click(feb29);
54
+ expect(onChangeMock).toBeCalledWith('testDate', LocalDate.of(2024, Month.FEBRUARY, 29), dateProperty);
55
+ }));
56
+ test('returns manually entered date', () => __awaiter(void 0, void 0, void 0, function* () {
57
+ const user = userEvent.setup();
58
+ const onChangeMock = jest.fn((name, value, property) => { });
59
+ render(React.createElement(DatePickerSelect, { id: "pickDate", property: dateProperty, onChange: onChangeMock }));
60
+ const input = screen.getByRole('textbox');
61
+ yield user.type(input, '03/27/2024');
62
+ expect(onChangeMock).toBeCalledTimes(8); // component ignores '/', i.e. input could also have been '03272024'
63
+ expect(onChangeMock).lastCalledWith('testDate', LocalDate.of(2024, Month.MARCH, 27), dateProperty);
64
+ }));
65
+ test('returns incomplete dates', () => __awaiter(void 0, void 0, void 0, function* () {
66
+ const user = userEvent.setup();
67
+ const onChangeMock = jest.fn((name, value, property) => { });
68
+ render(React.createElement(DatePickerSelect, { id: "pickDate", property: dateProperty, onChange: onChangeMock }));
69
+ const input = screen.getByRole('textbox');
70
+ yield user.type(input, '08/20');
71
+ // Component automatically appends '/' as needed.
72
+ expect(onChangeMock).lastCalledWith('testDate', new InvalidDate('08/20/'), dateProperty);
73
+ }));
@@ -1,4 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FormFieldProps } from '../FormField';
3
- declare const FileUploadControl: (props: FormFieldProps) => JSX.Element;
3
+ declare const FileUploadControl: (props: FormFieldProps & {
4
+ id: string;
5
+ }) => JSX.Element;
4
6
  export default FileUploadControl;
@@ -5,8 +5,7 @@ import { Button, TextField } from '../../../core';
5
5
  const FileUploadControl = (props) => {
6
6
  var _a;
7
7
  const [uploadedFile, setUploadedFile] = useState(undefined);
8
- const { property, required, error, errorMessage } = props;
9
- const id = property.id;
8
+ const { id, property, required, error, errorMessage } = props;
10
9
  const styles = {
11
10
  button: {
12
11
  textTransform: 'initial',
@@ -32,13 +31,13 @@ const FileUploadControl = (props) => {
32
31
  };
33
32
  useEffect(() => {
34
33
  if (uploadedFile) {
35
- props.onChange(id, uploadedFile, property);
34
+ props.onChange(property.id, uploadedFile, property);
36
35
  }
37
36
  }, [uploadedFile]);
38
37
  const handleSelectFile = () => {
39
38
  if (uploadedFile) {
40
39
  setUploadedFile(undefined);
41
- props.onChange(id, undefined, property);
40
+ props.onChange(property.id, undefined, property);
42
41
  }
43
42
  };
44
43
  const onDrop = useCallback((acceptedFile) => {
@@ -58,7 +57,7 @@ const FileUploadControl = (props) => {
58
57
  })),
59
58
  React.createElement(Grid, { item: true, flexGrow: 1 },
60
59
  React.createElement("input", Object.assign({ disabled: true }, getInputProps())),
61
- React.createElement(TextField, { sx: { '& fieldset': { border: 'none' } }, fullWidth: true, value: (_a = uploadedFile === null || uploadedFile === void 0 ? void 0 : uploadedFile.name) !== null && _a !== void 0 ? _a : (isDragActive ? 'Drop your file here' : 'File'), error: error, errorMessage: errorMessage, required: required })),
60
+ React.createElement(TextField, { id: id, sx: { '& fieldset': { border: 'none' } }, fullWidth: true, value: (_a = uploadedFile === null || uploadedFile === void 0 ? void 0 : uploadedFile.name) !== null && _a !== void 0 ? _a : (isDragActive ? 'Drop your file here' : 'File'), error: error, errorMessage: errorMessage, required: required })),
62
61
  React.createElement(Grid, { item: true },
63
62
  React.createElement(Button, { sx: Object.assign(Object.assign({}, styles.button), styles.selectFileBtn), onClick: () => handleSelectFile() }, uploadedFile ? 'Remove' : 'Select File'))));
64
63
  };
@@ -1,5 +1,6 @@
1
1
  import { ObjectProperty } from '../../../types';
2
2
  export declare type FormFieldProps = {
3
+ id?: string;
3
4
  property: ObjectProperty;
4
5
  onChange: Function;
5
6
  onBlur?: Function;
@@ -7,11 +7,10 @@ import InputFieldComponent from './InputFieldComponent/InputFieldComponent';
7
7
  import Select from './Select/Select';
8
8
  import TimePickerSelect from './TimePickerSelect/TimePickerSelect';
9
9
  const FormField = (props) => {
10
- const { defaultValue, error, onChange, property, readOnly, selectOptions, required, size, placeholder, errorMessage, onBlur, mask, max, min, isMultiLineText, rows, inputMaskPlaceholderChar, queryAddresses, isOptionEqualToValue, renderOption, disableCloseOnSelect, getOptionLabel } = props;
11
- const id = property.id;
10
+ const { id, defaultValue, error, onChange, property, readOnly, selectOptions, required, size, placeholder, errorMessage, onBlur, mask, max, min, isMultiLineText, rows, inputMaskPlaceholderChar, queryAddresses, isOptionEqualToValue, renderOption, disableCloseOnSelect, getOptionLabel, } = props;
12
11
  let control;
13
12
  const commonProps = {
14
- id,
13
+ id: id !== null && id !== void 0 ? id : property.id,
15
14
  property,
16
15
  onChange,
17
16
  onBlur,
@@ -1,5 +1,7 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { FormFieldProps } from '../FormField';
3
3
  export declare const NumericFormat: FunctionComponent<any>;
4
- declare const InputFieldComponent: (props: FormFieldProps) => JSX.Element;
4
+ declare const InputFieldComponent: (props: FormFieldProps & {
5
+ id: string;
6
+ }) => JSX.Element;
5
7
  export default InputFieldComponent;
@@ -27,10 +27,9 @@ export const NumericFormat = (props) => {
27
27
  };
28
28
  const InputFieldComponent = (props) => {
29
29
  var _a;
30
- const { property, defaultValue, error, errorMessage, onBlur, readOnly, required, size, placeholder, mask, min, max, isMultiLineText, rows, inputMaskPlaceholderChar, } = props;
30
+ const { id, property, defaultValue, error, errorMessage, onBlur, readOnly, required, size, placeholder, mask, min, max, isMultiLineText, rows, inputMaskPlaceholderChar, } = props;
31
31
  const [value, setValue] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
32
32
  const [inputValue, setInputValue] = useState('');
33
- const id = property.id;
34
33
  useEffect(() => {
35
34
  setValue(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
36
35
  }, [defaultValue]);
@@ -39,11 +38,11 @@ const InputFieldComponent = (props) => {
39
38
  ? parseInt(e.target.value, 10)
40
39
  : e.target.value;
41
40
  setValue(inputValue);
42
- props.onChange(id, inputValue, property);
41
+ props.onChange(property.id, inputValue, property);
43
42
  };
44
43
  const handleSelectChange = (e, selected) => {
45
44
  setValue(selected.label);
46
- props.onChange(id, selected.label, property);
45
+ props.onChange(property.id, selected.label, property);
47
46
  };
48
47
  const handleInputValueChange = (event, selectValue) => {
49
48
  setInputValue(selectValue);
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom/extend-expect';
@@ -0,0 +1,52 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import '@testing-library/jest-dom/extend-expect';
11
+ import React from 'react';
12
+ import { render, screen } from '@testing-library/react';
13
+ import { userEvent } from '@testing-library/user-event';
14
+ import InputField from './InputFieldComponent';
15
+ describe('Free-text input', () => {
16
+ // Right now an object property is required for this to function, but eventually this should go
17
+ // away.
18
+ const textProperty = {
19
+ id: 'inputField',
20
+ name: 'Input Field',
21
+ type: 'string',
22
+ };
23
+ test('returns entered value', () => __awaiter(void 0, void 0, void 0, function* () {
24
+ const user = userEvent.setup();
25
+ const onChangeMock = jest.fn((name, value, property) => { });
26
+ render(React.createElement(InputField, { id: "testInput", property: textProperty, onChange: onChangeMock }));
27
+ const input = screen.getByRole('textbox');
28
+ yield user.type(input, 'test value');
29
+ expect(onChangeMock).toBeCalledTimes(10);
30
+ expect(onChangeMock).lastCalledWith('inputField', 'test value', textProperty);
31
+ }));
32
+ });
33
+ describe('Autocomplete', () => {
34
+ // Right now an object property is required for this to function, but eventually this should go
35
+ // away.
36
+ const enumProperty = {
37
+ id: 'enumField',
38
+ name: 'Enum Field',
39
+ type: 'string',
40
+ enum: ['option 1', 'option 2'],
41
+ };
42
+ test('returns selected value', () => __awaiter(void 0, void 0, void 0, function* () {
43
+ const user = userEvent.setup();
44
+ const onChangeMock = jest.fn((name, value, property) => { });
45
+ render(React.createElement(InputField, { id: "testInput", property: enumProperty, onChange: onChangeMock }));
46
+ const input = screen.getByRole('combobox');
47
+ yield user.click(input);
48
+ const option2 = yield screen.findByRole('option', { name: 'option 2' });
49
+ yield user.click(option2);
50
+ expect(onChangeMock).toBeCalledWith('enumField', 'option 2', enumProperty);
51
+ }));
52
+ });
@@ -1,4 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FormFieldProps } from '../FormField';
3
- declare const Select: (props: FormFieldProps) => JSX.Element;
3
+ declare const Select: (props: FormFieldProps & {
4
+ id: string;
5
+ }) => JSX.Element;
4
6
  export default Select;
@@ -3,21 +3,20 @@ import { Autocomplete, TextField } from '../../../core';
3
3
  import InputFieldComponent from '../InputFieldComponent/InputFieldComponent';
4
4
  const Select = (props) => {
5
5
  var _a, _b;
6
- const { property, defaultValue, error, errorMessage, onBlur, readOnly, selectOptions, required, size, isOptionEqualToValue, renderOption, getOptionLabel, disableCloseOnSelect, } = props;
6
+ const { id, property, defaultValue, error, errorMessage, onBlur, readOnly, selectOptions, required, size, isOptionEqualToValue, renderOption, getOptionLabel, disableCloseOnSelect, } = props;
7
7
  const [value, setValue] = useState(defaultValue);
8
8
  const [inputValue, setInputValue] = useState('');
9
9
  useEffect(() => {
10
10
  setValue(defaultValue);
11
11
  }, [defaultValue]);
12
- const id = property.id;
13
12
  const handleChange = (event, selected) => {
14
13
  if (Array.isArray(selected)) {
15
14
  setValue(selected.map((option) => { var _a; return (_a = option.value) !== null && _a !== void 0 ? _a : option; }));
16
- props.onChange(id, selected.map((option) => { var _a; return (_a = option.value) !== null && _a !== void 0 ? _a : option; }), property);
15
+ props.onChange(property.id, selected.map((option) => { var _a; return (_a = option.value) !== null && _a !== void 0 ? _a : option; }), property);
17
16
  }
18
17
  else {
19
18
  setValue(selected);
20
- props.onChange(id, selected, property);
19
+ props.onChange(property.id, selected, property);
21
20
  }
22
21
  };
23
22
  const handleInputValueChange = (event, selectValue) => {
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom/extend-expect';
@@ -0,0 +1,68 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import '@testing-library/jest-dom/extend-expect';
11
+ import React from 'react';
12
+ import { render, screen } from '@testing-library/react';
13
+ import { userEvent } from '@testing-library/user-event';
14
+ import Select from './Select';
15
+ describe('Single select', () => {
16
+ // Right now an object property is required for this to function, but eventually this should go
17
+ // away.
18
+ const choiceProperty = {
19
+ id: 'selectOptions',
20
+ name: 'Select Options',
21
+ type: 'choices',
22
+ };
23
+ test('returns selected option', () => __awaiter(void 0, void 0, void 0, function* () {
24
+ const user = userEvent.setup();
25
+ const onChangeMock = jest.fn((name, value, property) => { });
26
+ const options = ['option 1', 'option 2', 'option 3'];
27
+ render(React.createElement(Select, { id: "testSelect", property: choiceProperty, selectOptions: options, onChange: onChangeMock }));
28
+ const input = screen.getByRole('combobox');
29
+ yield user.click(input);
30
+ const option2 = yield screen.findByRole('option', { name: 'option 2' });
31
+ yield user.click(option2);
32
+ expect(onChangeMock).toBeCalledWith('selectOptions', expect.objectContaining({ label: 'option 2', value: 'option 2' }), choiceProperty);
33
+ }));
34
+ test('displays matching options', () => __awaiter(void 0, void 0, void 0, function* () {
35
+ const user = userEvent.setup();
36
+ const options = ['option 1', 'option 2', 'something different'];
37
+ render(React.createElement(Select, { id: "testSelect", property: choiceProperty, selectOptions: options, onChange: () => { } }));
38
+ const input = screen.getByRole('combobox');
39
+ yield user.type(input, 'option');
40
+ yield screen.findByRole('option', { name: 'option 1' });
41
+ yield screen.findByRole('option', { name: 'option 2' });
42
+ expect(screen.queryByRole('option', { name: 'something different' })).not.toBeInTheDocument();
43
+ }));
44
+ });
45
+ describe('Multi select', () => {
46
+ // Right now an object property is required for this to function, but eventually this should go
47
+ // away.
48
+ const multiChoiceProperty = {
49
+ id: 'multiSelect',
50
+ name: 'Select Multiple',
51
+ type: 'array',
52
+ };
53
+ test('returns selected options', () => __awaiter(void 0, void 0, void 0, function* () {
54
+ const user = userEvent.setup();
55
+ const onChangeMock = jest.fn((name, value, property) => { });
56
+ const options = ['option 1', 'option 2', 'option 3'];
57
+ render(React.createElement(Select, { id: "testSelect", property: multiChoiceProperty, selectOptions: options, onChange: onChangeMock }));
58
+ const input = screen.getByRole('combobox');
59
+ yield user.click(input);
60
+ const option2 = yield screen.findByRole('option', { name: 'option 2' });
61
+ yield user.click(option2);
62
+ yield user.click(input); // selecting option closes the dropdown, re-open the options
63
+ const option3 = yield screen.findByRole('option', { name: 'option 3' });
64
+ yield user.click(option3);
65
+ expect(onChangeMock).toBeCalledTimes(2);
66
+ expect(onChangeMock).lastCalledWith('multiSelect', ['option 2', 'option 3'], multiChoiceProperty);
67
+ }));
68
+ });
@@ -1,4 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FormFieldProps } from '../FormField';
3
- declare const TimePickerSelect: (props: FormFieldProps) => JSX.Element;
3
+ declare const TimePickerSelect: (props: FormFieldProps & {
4
+ id: string;
5
+ }) => JSX.Element;
4
6
  export default TimePickerSelect;
@@ -5,13 +5,12 @@ import { LocalDateTime } from '@js-joda/core';
5
5
  import { padStart } from 'lodash-es';
6
6
  import { InvalidDate } from '../../../../util';
7
7
  const TimePickerSelect = (props) => {
8
- const { property, defaultValue, error, errorMessage, readOnly, required, size, onBlur, placeholder } = props;
8
+ const { id, property, defaultValue, error, errorMessage, readOnly, required, size, onBlur, placeholder } = props;
9
9
  const values = defaultValue ? defaultValue.split(':') : undefined;
10
10
  const hour = values ? parseInt(values[0]) : undefined;
11
11
  const minute = values ? parseInt(values[1]) : undefined;
12
12
  const second = values ? parseInt(values[2]) : undefined;
13
13
  const [value, setValue] = useState(defaultValue ? LocalDateTime.now().withHour(hour).withMinute(minute).withSecond(second) : null);
14
- const id = property.id;
15
14
  useEffect(() => {
16
15
  if (defaultValue) {
17
16
  const values = defaultValue.split(':');
@@ -31,11 +30,11 @@ const TimePickerSelect = (props) => {
31
30
  const hour = padStart(date === null || date === void 0 ? void 0 : date.hour().toString(), 2, '0');
32
31
  const minute = padStart(date === null || date === void 0 ? void 0 : date.minute().toString(), 2, '0');
33
32
  const second = padStart(date === null || date === void 0 ? void 0 : date.second().toString(), 2, '0');
34
- props.onChange(id, `${hour}:${minute}:${second}`, property);
33
+ props.onChange(property.id, `${hour}:${minute}:${second}`, property);
35
34
  }
36
35
  else {
37
36
  setValue(null);
38
- props.onChange(id, date, property);
37
+ props.onChange(property.id, date, property);
39
38
  }
40
39
  };
41
40
  return (React.createElement(LocalizationProvider, null,
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { MenuBar as CustomMenuBar } from '../index';
3
3
  import { Link } from '@mui/material';
4
- const logo = require('../SA_logo.jpeg');
4
+ const logo = require('../assets/SA_logo.jpeg');
5
5
  export default {
6
6
  title: 'Data Display/MenuBar',
7
7
  component: CustomMenuBar,
@@ -1,5 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { ComponentStory, ComponentMeta } from '@storybook/react';
3
- declare const _default: ComponentMeta<(props: import("../components/custom/FormField/FormField").FormFieldProps) => JSX.Element>;
3
+ declare const _default: ComponentMeta<(props: import("../components/custom/FormField/FormField").FormFieldProps & {
4
+ id: string;
5
+ }) => JSX.Element>;
4
6
  export default _default;
5
- export declare const TimePicker: ComponentStory<(props: import("../components/custom/FormField/FormField").FormFieldProps) => JSX.Element>;
7
+ export declare const TimePicker: ComponentStory<(props: import("../components/custom/FormField/FormField").FormFieldProps & {
8
+ id: string;
9
+ }) => JSX.Element>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/ui-components",
3
- "version": "1.0.0-dev.183",
3
+ "version": "1.0.0-dev.185",
4
4
  "description": "",
5
5
  "main": "dist/published/index.js",
6
6
  "module": "dist/published/index.js",
@@ -44,6 +44,7 @@
44
44
  "@storybook/testing-library": "^0.0.11",
45
45
  "@testing-library/jest-dom": "^5.16.4",
46
46
  "@testing-library/react": "^13.3.0",
47
+ "@testing-library/user-event": "^14.5.2",
47
48
  "@types/jest": "^28.1.4",
48
49
  "@types/node": "^17.0.41",
49
50
  "@types/react": "^17.0.49",
@@ -52,7 +53,9 @@
52
53
  "babel-loader": "^8.2.5",
53
54
  "copyfiles": "^2.4.1",
54
55
  "eslint": "^8.22.0",
56
+ "eslint-plugin-jest-dom": "^5.2.0",
55
57
  "eslint-plugin-prettier": "^4.2.1",
58
+ "eslint-plugin-testing-library": "^6.2.0",
56
59
  "husky": "^4.3.8",
57
60
  "is-ci": "^3.0.1",
58
61
  "jest": "^28.1.2",
@@ -106,6 +109,10 @@
106
109
  },
107
110
  "jest": {
108
111
  "verbose": true,
109
- "testEnvironment": "jsdom"
112
+ "testEnvironment": "jsdom",
113
+ "testPathIgnorePatterns": [
114
+ "/node_modules/",
115
+ "<rootDir>/dist/"
116
+ ]
110
117
  }
111
118
  }