@hipay/hipay-material-ui 2.3.1-rc4 → 2.3.1-rc5
Sign up to get free protection for your applications and to get access to all the features.
- package/HiAlertModal/HiAlertModal.js +77 -48
- package/HiAlertModal/index.js +15 -1
- package/HiAppBar/HiAppBar.js +63 -34
- package/HiAppBar/index.js +15 -1
- package/HiBadge/HiBadge.js +29 -10
- package/HiBadge/index.js +15 -1
- package/HiBreadcrumb/HiBreadcrumb.js +41 -27
- package/HiBreadcrumb/HiStep.js +58 -35
- package/HiBreadcrumb/HiStepConnector.js +58 -33
- package/HiBreadcrumb/HiStepContent.js +47 -26
- package/HiBreadcrumb/HiStepIcon.js +47 -27
- package/HiBreadcrumb/HiStepLabel.js +62 -37
- package/HiBreadcrumb/HiStepper.js +44 -24
- package/HiBreadcrumb/index.js +15 -1
- package/HiButton/HiButton.js +27 -9
- package/HiButton/index.js +13 -2
- package/HiCell/CellAddress.js +39 -21
- package/HiCell/CellDate.js +44 -27
- package/HiCell/CellIcon.js +48 -29
- package/HiCell/CellImage.js +41 -24
- package/HiCell/CellNumeric.js +45 -26
- package/HiCell/CellPinToAction.js +41 -20
- package/HiCell/CellRate.js +56 -33
- package/HiCell/CellSentinel.js +41 -23
- package/HiCell/CellSentinelScore.js +43 -24
- package/HiCell/CellText.js +54 -37
- package/HiCell/CellTextStyled.js +21 -8
- package/HiCell/index.js +79 -9
- package/HiCheckbox/HiCheckbox.js +61 -36
- package/HiCheckbox/index.js +15 -1
- package/HiChip/HiChip.js +44 -24
- package/HiChip/HiChipSwitch.js +73 -47
- package/HiChip/index.js +23 -2
- package/HiColoredLabel/HiColoredLabel.js +52 -28
- package/HiColoredLabel/index.js +15 -1
- package/HiDatePicker/Caption.js +28 -11
- package/HiDatePicker/HiDatePicker.js +131 -101
- package/HiDatePicker/HiDatePickerMobile.js +54 -32
- package/HiDatePicker/HiDateRangePicker.js +168 -139
- package/HiDatePicker/HiDateRangeSelector.js +105 -71
- package/HiDatePicker/ListPicker.js +54 -34
- package/HiDatePicker/NavBar.js +45 -18
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +40 -23
- package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +39 -22
- package/HiDatePicker/Overlays/MonthPickerOverlay.js +44 -30
- package/HiDatePicker/Overlays/Overlay.js +35 -18
- package/HiDatePicker/Overlays/TimePickerOverlay.js +72 -48
- package/HiDatePicker/Overlays/YearPickerOverlay.js +44 -30
- package/HiDatePicker/Overlays/index.js +47 -5
- package/HiDatePicker/Weekday.js +13 -3
- package/HiDatePicker/hiLocaleUtils.js +8 -1
- package/HiDatePicker/index.js +15 -1
- package/HiDatePicker/stylesheet.js +22 -9
- package/HiDotsStepper/HiDot.js +56 -31
- package/HiDotsStepper/HiDotsStepper.js +47 -28
- package/HiDotsStepper/index.js +23 -2
- package/HiExpansionPanel/HiExpansionPanel.js +73 -43
- package/HiExpansionPanel/index.js +13 -2
- package/HiForm/HiAddressField.js +46 -29
- package/HiForm/HiEmailField.js +45 -27
- package/HiForm/HiFormControl.js +105 -72
- package/HiForm/HiFormLabel.js +53 -30
- package/HiForm/HiInput.js +89 -62
- package/HiForm/HiPasswordField.js +55 -29
- package/HiForm/HiSearchField.js +43 -28
- package/HiForm/HiSlider.js +64 -41
- package/HiForm/HiTextField.js +46 -29
- package/HiForm/HiUpload.js +76 -53
- package/HiForm/HiUploadField.js +40 -25
- package/HiForm/HiUploadInput.js +84 -56
- package/HiForm/index.js +95 -11
- package/HiIcon/HiIcon.js +44 -22
- package/HiIcon/index.js +15 -1
- package/HiIconButton/HiIconButton.js +40 -18
- package/HiIconButton/index.js +15 -1
- package/HiLoader/HiLoader.js +24 -9
- package/HiLoader/index.js +15 -1
- package/HiMap/HiMap.js +76 -51
- package/HiMap/HiMapExpand.js +64 -39
- package/HiMap/index.js +23 -2
- package/HiNotice/HiKPI.js +56 -33
- package/HiNotice/HiKPINotice.js +21 -7
- package/HiNotice/index.js +23 -2
- package/HiPaymentMeans/HiPaymentMeans.js +133 -112
- package/HiPaymentMeans/index.js +15 -1
- package/HiPdfReader/HiPdfReader.js +78 -52
- package/HiPdfReader/index.js +15 -1
- package/HiPin/HiPin.js +30 -9
- package/HiPin/index.js +15 -1
- package/HiRadio/HiRadio.js +24 -7
- package/HiRadio/index.js +15 -1
- package/HiSelect/HiDynamicSelect.js +58 -40
- package/HiSelect/HiDynamicSelectField.js +40 -22
- package/HiSelect/HiNestedSelect.js +85 -55
- package/HiSelect/HiNestedSelectContent.js +72 -46
- package/HiSelect/HiNestedSelectField.js +40 -22
- package/HiSelect/HiSelect.js +161 -123
- package/HiSelect/HiSelectContent.js +104 -73
- package/HiSelect/HiSelectField.js +40 -22
- package/HiSelect/HiSelectInput.js +94 -63
- package/HiSelect/HiSelectMobile.js +54 -35
- package/HiSelect/HiSuggestSelect.js +83 -56
- package/HiSelect/HiSuggestSelectField.js +40 -22
- package/HiSelect/index.js +85 -8
- package/HiSelectableList/HiSelectableList.js +80 -49
- package/HiSelectableList/HiSelectableListHierarchic.js +55 -35
- package/HiSelectableList/HiSelectableListItem.js +101 -66
- package/HiSelectableList/index.js +31 -3
- package/HiSwitch/HiSwitch.js +45 -20
- package/HiSwitch/HiSwitchState.js +36 -15
- package/HiSwitch/index.js +23 -2
- package/HiTable/HiCellBuilder.js +69 -43
- package/HiTable/HiTable.js +46 -28
- package/HiTable/HiTableBody.js +34 -19
- package/HiTable/HiTableHeader.js +50 -29
- package/HiTable/HiTableRow.js +56 -29
- package/HiTable/constants.js +94 -43
- package/HiTable/index.js +15 -1
- package/es/HiAlertModal/HiAlertModal.js +77 -48
- package/es/HiAlertModal/index.js +15 -1
- package/es/HiAppBar/HiAppBar.js +63 -34
- package/es/HiAppBar/index.js +15 -1
- package/es/HiBadge/HiBadge.js +29 -10
- package/es/HiBadge/index.js +15 -1
- package/es/HiBreadcrumb/HiBreadcrumb.js +41 -27
- package/es/HiBreadcrumb/HiStep.js +58 -35
- package/es/HiBreadcrumb/HiStepConnector.js +58 -33
- package/es/HiBreadcrumb/HiStepContent.js +47 -26
- package/es/HiBreadcrumb/HiStepIcon.js +47 -27
- package/es/HiBreadcrumb/HiStepLabel.js +62 -37
- package/es/HiBreadcrumb/HiStepper.js +44 -24
- package/es/HiBreadcrumb/index.js +15 -1
- package/es/HiButton/HiButton.js +27 -9
- package/es/HiButton/index.js +13 -2
- package/es/HiCell/CellAddress.js +39 -21
- package/es/HiCell/CellDate.js +44 -27
- package/es/HiCell/CellIcon.js +48 -29
- package/es/HiCell/CellImage.js +41 -24
- package/es/HiCell/CellNumeric.js +45 -26
- package/es/HiCell/CellPinToAction.js +41 -20
- package/es/HiCell/CellRate.js +56 -33
- package/es/HiCell/CellSentinel.js +41 -23
- package/es/HiCell/CellSentinelScore.js +43 -24
- package/es/HiCell/CellText.js +54 -37
- package/es/HiCell/CellTextStyled.js +21 -8
- package/es/HiCell/index.js +79 -9
- package/es/HiCheckbox/HiCheckbox.js +61 -36
- package/es/HiCheckbox/index.js +15 -1
- package/es/HiChip/HiChip.js +44 -24
- package/es/HiChip/HiChipSwitch.js +73 -47
- package/es/HiChip/index.js +23 -2
- package/es/HiColoredLabel/HiColoredLabel.js +52 -28
- package/es/HiColoredLabel/index.js +15 -1
- package/es/HiDatePicker/Caption.js +28 -11
- package/es/HiDatePicker/HiDatePicker.js +131 -101
- package/es/HiDatePicker/HiDatePickerMobile.js +54 -32
- package/es/HiDatePicker/HiDateRangePicker.js +168 -139
- package/es/HiDatePicker/HiDateRangeSelector.js +105 -71
- package/es/HiDatePicker/ListPicker.js +54 -34
- package/es/HiDatePicker/NavBar.js +45 -18
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +40 -23
- package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +39 -22
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +44 -30
- package/es/HiDatePicker/Overlays/Overlay.js +35 -18
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +72 -48
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +44 -30
- package/es/HiDatePicker/Overlays/index.js +47 -5
- package/es/HiDatePicker/Weekday.js +13 -3
- package/es/HiDatePicker/hiLocaleUtils.js +8 -1
- package/es/HiDatePicker/index.js +15 -1
- package/es/HiDatePicker/stylesheet.js +22 -9
- package/es/HiDotsStepper/HiDot.js +56 -31
- package/es/HiDotsStepper/HiDotsStepper.js +47 -28
- package/es/HiDotsStepper/index.js +23 -2
- package/es/HiExpansionPanel/HiExpansionPanel.js +73 -43
- package/es/HiExpansionPanel/index.js +13 -2
- package/es/HiForm/HiAddressField.js +46 -29
- package/es/HiForm/HiEmailField.js +45 -27
- package/es/HiForm/HiFormControl.js +105 -72
- package/es/HiForm/HiFormLabel.js +53 -30
- package/es/HiForm/HiInput.js +89 -62
- package/es/HiForm/HiPasswordField.js +55 -29
- package/es/HiForm/HiSearchField.js +43 -28
- package/es/HiForm/HiSlider.js +64 -41
- package/es/HiForm/HiTextField.js +46 -29
- package/es/HiForm/HiUpload.js +76 -53
- package/es/HiForm/HiUploadField.js +40 -25
- package/es/HiForm/HiUploadInput.js +84 -56
- package/es/HiForm/index.js +95 -11
- package/es/HiIcon/HiIcon.js +44 -22
- package/es/HiIcon/index.js +15 -1
- package/es/HiIconButton/HiIconButton.js +40 -18
- package/es/HiIconButton/index.js +15 -1
- package/es/HiLoader/HiLoader.js +24 -9
- package/es/HiLoader/index.js +15 -1
- package/es/HiMap/HiMap.js +76 -51
- package/es/HiMap/HiMapExpand.js +64 -39
- package/es/HiMap/index.js +23 -2
- package/es/HiNotice/HiKPI.js +56 -33
- package/es/HiNotice/HiKPINotice.js +21 -7
- package/es/HiNotice/index.js +23 -2
- package/es/HiPaymentMeans/HiPaymentMeans.js +133 -112
- package/es/HiPaymentMeans/index.js +15 -1
- package/es/HiPdfReader/HiPdfReader.js +78 -52
- package/es/HiPdfReader/index.js +15 -1
- package/es/HiPin/HiPin.js +30 -9
- package/es/HiPin/index.js +15 -1
- package/es/HiRadio/HiRadio.js +24 -7
- package/es/HiRadio/index.js +15 -1
- package/es/HiSelect/HiDynamicSelect.js +58 -40
- package/es/HiSelect/HiDynamicSelectField.js +40 -22
- package/es/HiSelect/HiNestedSelect.js +85 -55
- package/es/HiSelect/HiNestedSelectContent.js +72 -46
- package/es/HiSelect/HiNestedSelectField.js +40 -22
- package/es/HiSelect/HiSelect.js +161 -123
- package/es/HiSelect/HiSelectContent.js +104 -73
- package/es/HiSelect/HiSelectField.js +40 -22
- package/es/HiSelect/HiSelectInput.js +94 -63
- package/es/HiSelect/HiSelectMobile.js +54 -35
- package/es/HiSelect/HiSuggestSelect.js +83 -56
- package/es/HiSelect/HiSuggestSelectField.js +40 -22
- package/es/HiSelect/index.js +85 -8
- package/es/HiSelectableList/HiSelectableList.js +80 -49
- package/es/HiSelectableList/HiSelectableListHierarchic.js +55 -35
- package/es/HiSelectableList/HiSelectableListItem.js +101 -66
- package/es/HiSelectableList/index.js +31 -3
- package/es/HiSwitch/HiSwitch.js +45 -20
- package/es/HiSwitch/HiSwitchState.js +36 -15
- package/es/HiSwitch/index.js +23 -2
- package/es/HiTable/HiCellBuilder.js +69 -43
- package/es/HiTable/HiTable.js +46 -28
- package/es/HiTable/HiTableBody.js +34 -19
- package/es/HiTable/HiTableHeader.js +50 -29
- package/es/HiTable/HiTableRow.js +56 -29
- package/es/HiTable/constants.js +94 -43
- package/es/HiTable/index.js +15 -1
- package/es/hi-svg-icons/HiAccount.js +36 -18
- package/es/hi-svg-icons/HiActivity.js +35 -17
- package/es/hi-svg-icons/HiAll.js +42 -22
- package/es/hi-svg-icons/HiBilling.js +36 -18
- package/es/hi-svg-icons/HiBriefcaseRescue.js +26 -10
- package/es/hi-svg-icons/HiCatalog.js +36 -18
- package/es/hi-svg-icons/HiCustomer.js +36 -18
- package/es/hi-svg-icons/HiDownload.js +25 -11
- package/es/hi-svg-icons/HiFinance.js +36 -18
- package/es/hi-svg-icons/HiPermission.js +35 -17
- package/es/hi-svg-icons/HiRoute.js +36 -18
- package/es/hi-svg-icons/HiSettlement.js +36 -18
- package/es/hi-svg-icons/HiSizeLarge.js +27 -12
- package/es/hi-svg-icons/HiSizeMedium.js +25 -11
- package/es/hi-svg-icons/HiSizeSmall.js +25 -11
- package/es/hi-svg-icons/HiTransaction.js +36 -18
- package/es/hi-svg-icons/HiUser.js +36 -18
- package/es/hi-svg-icons/HiWidget.js +42 -22
- package/es/hi-svg-icons/index.js +151 -18
- package/es/hi-svg-icons/index.text.js +21 -11
- package/es/styleguide/Wrapper.js +36 -19
- package/es/styles/MuiThemeProvider.js +57 -39
- package/es/styles/colorManipulator.js +44 -16
- package/es/styles/createBreakpoints.js +20 -6
- package/es/styles/createGenerateClassName.js +15 -5
- package/es/styles/createMixins.js +19 -8
- package/es/styles/createMuiTheme.js +53 -34
- package/es/styles/createPalette.js +50 -30
- package/es/styles/createStyles.js +8 -1
- package/es/styles/createTypography.js +30 -18
- package/es/styles/getStylesCreator.js +24 -11
- package/es/styles/getThemeProps.js +9 -1
- package/es/styles/index.js +47 -5
- package/es/styles/jssPreset.js +25 -9
- package/es/styles/mergeClasses.js +19 -7
- package/es/styles/shadows.js +8 -1
- package/es/styles/shape.js +8 -1
- package/es/styles/spacing.js +9 -1
- package/es/styles/themeListener.js +18 -5
- package/es/styles/transitions.js +38 -18
- package/es/styles/zIndex.js +8 -1
- package/es/test-utils/createMount.js +22 -11
- package/es/test-utils/createRender.js +19 -8
- package/es/test-utils/createShallow.js +23 -13
- package/es/test-utils/getClasses.js +11 -2
- package/es/test-utils/index.js +47 -5
- package/es/test-utils/until.js +16 -6
- package/es/test-utils/unwrap.js +8 -1
- package/es/theme/palette.js +10 -2
- package/es/theme/typography.js +11 -3
- package/es/theme.js +13 -4
- package/es/transitions/utils.js +13 -2
- package/es/utils/exactProp.js +18 -5
- package/es/utils/helpers.js +55 -18
- package/es/withMobileDialog/index.js +15 -1
- package/es/withMobileDialog/withMobileDialog.js +22 -7
- package/hi-svg-icons/HiAccount.js +36 -18
- package/hi-svg-icons/HiActivity.js +35 -17
- package/hi-svg-icons/HiAll.js +42 -22
- package/hi-svg-icons/HiBilling.js +36 -18
- package/hi-svg-icons/HiBriefcaseRescue.js +26 -10
- package/hi-svg-icons/HiCatalog.js +36 -18
- package/hi-svg-icons/HiCustomer.js +36 -18
- package/hi-svg-icons/HiDownload.js +25 -11
- package/hi-svg-icons/HiFinance.js +36 -18
- package/hi-svg-icons/HiPermission.js +35 -17
- package/hi-svg-icons/HiRoute.js +36 -18
- package/hi-svg-icons/HiSettlement.js +36 -18
- package/hi-svg-icons/HiSizeLarge.js +27 -12
- package/hi-svg-icons/HiSizeMedium.js +25 -11
- package/hi-svg-icons/HiSizeSmall.js +25 -11
- package/hi-svg-icons/HiTransaction.js +36 -18
- package/hi-svg-icons/HiUser.js +36 -18
- package/hi-svg-icons/HiWidget.js +42 -22
- package/hi-svg-icons/index.js +151 -18
- package/hi-svg-icons/index.text.js +21 -11
- package/package.json +2 -1
- package/styleguide/Wrapper.js +36 -19
- package/styles/MuiThemeProvider.js +57 -39
- package/styles/colorManipulator.js +44 -16
- package/styles/createBreakpoints.js +20 -6
- package/styles/createGenerateClassName.js +15 -5
- package/styles/createMixins.js +19 -8
- package/styles/createMuiTheme.js +53 -34
- package/styles/createPalette.js +50 -30
- package/styles/createStyles.js +8 -1
- package/styles/createTypography.js +30 -18
- package/styles/getStylesCreator.js +24 -11
- package/styles/getThemeProps.js +9 -1
- package/styles/index.js +47 -5
- package/styles/jssPreset.js +25 -9
- package/styles/mergeClasses.js +19 -7
- package/styles/shadows.js +8 -1
- package/styles/shape.js +8 -1
- package/styles/spacing.js +9 -1
- package/styles/themeListener.js +18 -5
- package/styles/transitions.js +38 -18
- package/styles/zIndex.js +8 -1
- package/test-utils/createMount.js +22 -11
- package/test-utils/createRender.js +19 -8
- package/test-utils/createShallow.js +23 -13
- package/test-utils/getClasses.js +11 -2
- package/test-utils/index.js +47 -5
- package/test-utils/until.js +16 -6
- package/test-utils/unwrap.js +8 -1
- package/theme/palette.js +10 -2
- package/theme/typography.js +11 -3
- package/theme.js +13 -4
- package/transitions/utils.js +13 -2
- package/utils/exactProp.js +18 -5
- package/utils/helpers.js +55 -18
- package/withMobileDialog/index.js +15 -1
- package/withMobileDialog/withMobileDialog.js +22 -7
- package/App.test.js +0 -8
- package/HiAlertModal/HiAlertModal.test.js +0 -189
- package/HiBadge/HiBadge.test.js +0 -49
- package/HiBreadcrumb/HiBreadcrumb.test.js +0 -44
- package/HiBreadcrumb/HiStep.test.js +0 -47
- package/HiBreadcrumb/HiStepConnector.test.js +0 -113
- package/HiBreadcrumb/HiStepContent.test.js +0 -32
- package/HiBreadcrumb/HiStepIcon.test.js +0 -65
- package/HiBreadcrumb/HiStepLabel.test.js +0 -30
- package/HiBreadcrumb/HiStepper.test.js +0 -33
- package/HiCell/CellAddress.test.js +0 -75
- package/HiCell/CellDate.test.js +0 -173
- package/HiCell/CellIcon.test.js +0 -57
- package/HiCell/CellImage.test.js +0 -49
- package/HiCell/CellNumeric.test.js +0 -46
- package/HiCell/CellRate.test.js +0 -73
- package/HiCell/CellSentinel.test.js +0 -48
- package/HiCell/CellText.test.js +0 -76
- package/HiCheckbox/HiCheckbox.test.js +0 -55
- package/HiChip/HiChip.test.js +0 -136
- package/HiChip/HiChipSwitch.test.js +0 -99
- package/HiColoredLabel/HiColoredLabel.test.js +0 -96
- package/HiDatePicker/Caption.test.js +0 -65
- package/HiDatePicker/HiDatePicker.test.js +0 -370
- package/HiDatePicker/HiDateRangePicker.test.js +0 -703
- package/HiDatePicker/HiDateRangeSelector.test.js +0 -193
- package/HiDatePicker/ListPicker.test.js +0 -53
- package/HiDatePicker/NavBar.test.js +0 -39
- package/HiDatePicker/Overlays/MonthPickerOverlay.test.js +0 -50
- package/HiDatePicker/Overlays/Overlay.test.js +0 -20
- package/HiDatePicker/Overlays/TimePickerOverlay.test.js +0 -48
- package/HiDatePicker/Overlays/YearPickerOverlay.test.js +0 -79
- package/HiDatePicker/hiLocaleUtils.test.js +0 -51
- package/HiDotsStepper/HiDot.test.js +0 -55
- package/HiDotsStepper/HiDotsStepper.test.js +0 -90
- package/HiForm/HiAddressField.test.js +0 -79
- package/HiForm/HiEmailField.test.js +0 -19
- package/HiForm/HiFormControl.test.js +0 -195
- package/HiForm/HiFormLabel.test.js +0 -66
- package/HiForm/HiInput.test.js +0 -202
- package/HiForm/HiPasswordField.test.js +0 -60
- package/HiForm/HiSearchField.test.js +0 -193
- package/HiForm/HiSlider.test.js +0 -99
- package/HiForm/HiTextField.test.js +0 -254
- package/HiForm/HiUpload.test.js +0 -241
- package/HiForm/HiUploadField.test.js +0 -55
- package/HiForm/HiUploadInput.test.js +0 -148
- package/HiIconButton/HiIconButton.test.js +0 -69
- package/HiLoader/HiLoader.test.js +0 -18
- package/HiMap/HiMap.test.js +0 -29
- package/HiMap/HiMapExpand.test.js +0 -48
- package/HiNotice/HiKPI.test.js +0 -171
- package/HiNotice/HiKPINotice.test.js +0 -88
- package/HiPaymentMeans/HiPaymentMeans.test.js +0 -162
- package/HiPin/HiPin.test.js +0 -61
- package/HiRadio/HiRadio.test.js +0 -57
- package/HiSelect/HiSelect.test.js +0 -1092
- package/HiSelect/HiSelectInput.test.js +0 -21
- package/HiSelectableList/HiSelectableList.test.js +0 -173
- package/HiSelectableList/HiSelectableListItem.test.js +0 -97
- package/HiSwitch/HiSwitch.test.js +0 -41
- package/HiSwitch/HiSwitchState.test.js +0 -76
- package/HiTable/HiTable.test.js +0 -29
- package/es/App.test.js +0 -8
- package/es/HiAlertModal/HiAlertModal.test.js +0 -189
- package/es/HiBadge/HiBadge.test.js +0 -49
- package/es/HiBreadcrumb/HiBreadcrumb.test.js +0 -44
- package/es/HiBreadcrumb/HiStep.test.js +0 -47
- package/es/HiBreadcrumb/HiStepConnector.test.js +0 -113
- package/es/HiBreadcrumb/HiStepContent.test.js +0 -32
- package/es/HiBreadcrumb/HiStepIcon.test.js +0 -65
- package/es/HiBreadcrumb/HiStepLabel.test.js +0 -30
- package/es/HiBreadcrumb/HiStepper.test.js +0 -33
- package/es/HiCell/CellAddress.test.js +0 -75
- package/es/HiCell/CellDate.test.js +0 -173
- package/es/HiCell/CellIcon.test.js +0 -57
- package/es/HiCell/CellImage.test.js +0 -49
- package/es/HiCell/CellNumeric.test.js +0 -46
- package/es/HiCell/CellRate.test.js +0 -73
- package/es/HiCell/CellSentinel.test.js +0 -48
- package/es/HiCell/CellText.test.js +0 -76
- package/es/HiCheckbox/HiCheckbox.test.js +0 -55
- package/es/HiChip/HiChip.test.js +0 -136
- package/es/HiChip/HiChipSwitch.test.js +0 -99
- package/es/HiColoredLabel/HiColoredLabel.test.js +0 -96
- package/es/HiDatePicker/Caption.test.js +0 -65
- package/es/HiDatePicker/HiDatePicker.test.js +0 -370
- package/es/HiDatePicker/HiDateRangePicker.test.js +0 -703
- package/es/HiDatePicker/HiDateRangeSelector.test.js +0 -193
- package/es/HiDatePicker/ListPicker.test.js +0 -53
- package/es/HiDatePicker/NavBar.test.js +0 -39
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.test.js +0 -50
- package/es/HiDatePicker/Overlays/Overlay.test.js +0 -20
- package/es/HiDatePicker/Overlays/TimePickerOverlay.test.js +0 -48
- package/es/HiDatePicker/Overlays/YearPickerOverlay.test.js +0 -79
- package/es/HiDatePicker/hiLocaleUtils.test.js +0 -51
- package/es/HiDotsStepper/HiDot.test.js +0 -55
- package/es/HiDotsStepper/HiDotsStepper.test.js +0 -90
- package/es/HiForm/HiAddressField.test.js +0 -79
- package/es/HiForm/HiEmailField.test.js +0 -19
- package/es/HiForm/HiFormControl.test.js +0 -195
- package/es/HiForm/HiFormLabel.test.js +0 -66
- package/es/HiForm/HiInput.test.js +0 -202
- package/es/HiForm/HiPasswordField.test.js +0 -60
- package/es/HiForm/HiSearchField.test.js +0 -193
- package/es/HiForm/HiSlider.test.js +0 -99
- package/es/HiForm/HiTextField.test.js +0 -254
- package/es/HiForm/HiUpload.test.js +0 -241
- package/es/HiForm/HiUploadField.test.js +0 -55
- package/es/HiForm/HiUploadInput.test.js +0 -148
- package/es/HiIconButton/HiIconButton.test.js +0 -69
- package/es/HiLoader/HiLoader.test.js +0 -18
- package/es/HiMap/HiMap.test.js +0 -29
- package/es/HiMap/HiMapExpand.test.js +0 -48
- package/es/HiNotice/HiKPI.test.js +0 -171
- package/es/HiNotice/HiKPINotice.test.js +0 -88
- package/es/HiPaymentMeans/HiPaymentMeans.test.js +0 -162
- package/es/HiPin/HiPin.test.js +0 -61
- package/es/HiRadio/HiRadio.test.js +0 -57
- package/es/HiSelect/HiSelect.test.js +0 -1092
- package/es/HiSelect/HiSelectInput.test.js +0 -21
- package/es/HiSelectableList/HiSelectableList.test.js +0 -173
- package/es/HiSelectableList/HiSelectableListItem.test.js +0 -97
- package/es/HiSwitch/HiSwitch.test.js +0 -41
- package/es/HiSwitch/HiSwitchState.test.js +0 -76
- package/es/HiTable/HiTable.test.js +0 -29
- package/es/styles/colorManipulator.test.js +0 -242
- package/es/styles/createBreakpoints.test.js +0 -48
- package/es/styles/createGenerateClassName.test.js +0 -141
- package/es/styles/createMixins.test.js +0 -24
- package/es/styles/createMuiTheme.test.js +0 -67
- package/es/styles/createPalette.test.js +0 -159
- package/es/styles/createStyles.test.js +0 -8
- package/es/styles/createTypography.test.js +0 -60
- package/es/styles/getStylesCreator.test.js +0 -92
- package/es/styles/getThemeProps.test.js +0 -39
- package/es/styles/themeListener.test.js +0 -26
- package/es/styles/transitions.test.js +0 -208
- package/es/test-utils/until.test.js +0 -157
- package/es/withMobileDialog/withMobileDialog.test.js +0 -67
- package/styles/colorManipulator.test.js +0 -242
- package/styles/createBreakpoints.test.js +0 -48
- package/styles/createGenerateClassName.test.js +0 -141
- package/styles/createMixins.test.js +0 -24
- package/styles/createMuiTheme.test.js +0 -67
- package/styles/createPalette.test.js +0 -159
- package/styles/createStyles.test.js +0 -8
- package/styles/createTypography.test.js +0 -60
- package/styles/getStylesCreator.test.js +0 -92
- package/styles/getThemeProps.test.js +0 -39
- package/styles/themeListener.test.js +0 -26
- package/styles/transitions.test.js +0 -208
- package/test-utils/until.test.js +0 -157
- package/withMobileDialog/withMobileDialog.test.js +0 -67
@@ -1,60 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { createShallow, createMount } from '../test-utils';
|
4
|
-
import HiPasswordField from './HiPasswordField';
|
5
|
-
import HiTextField from './HiTextField';
|
6
|
-
import HiInput from './HiInput';
|
7
|
-
describe('<HiPasswordField />', function () {
|
8
|
-
var shallow;
|
9
|
-
var mount;
|
10
|
-
before(function () {
|
11
|
-
shallow = createShallow({
|
12
|
-
dive: true
|
13
|
-
});
|
14
|
-
mount = createMount();
|
15
|
-
});
|
16
|
-
after(function () {
|
17
|
-
mount.cleanUp();
|
18
|
-
});
|
19
|
-
describe('shallow', function () {
|
20
|
-
var wrapper;
|
21
|
-
beforeEach(function () {
|
22
|
-
wrapper = shallow(React.createElement(HiPasswordField, {
|
23
|
-
id: "password"
|
24
|
-
}));
|
25
|
-
});
|
26
|
-
describe('structure', function () {
|
27
|
-
it('should pass className to the FormControl', function () {
|
28
|
-
wrapper.setProps({
|
29
|
-
className: 'foo'
|
30
|
-
});
|
31
|
-
assert.strictEqual(wrapper.dive().hasClass('foo'), true);
|
32
|
-
});
|
33
|
-
it('should forward the fullWidth prop to FormControl', function () {
|
34
|
-
wrapper = shallow(React.createElement(HiPasswordField, {
|
35
|
-
id: "password",
|
36
|
-
fullWidth: true
|
37
|
-
}));
|
38
|
-
assert.strictEqual(wrapper.props().fullWidth, true);
|
39
|
-
});
|
40
|
-
it('should forward the fullWidth prop to FormControl', function () {
|
41
|
-
// Handle suggestions
|
42
|
-
assert.strictEqual(wrapper.state().showText, false);
|
43
|
-
wrapper.find(HiTextField).props().onRightIconClick();
|
44
|
-
assert.strictEqual(wrapper.state().showText, true);
|
45
|
-
wrapper.find(HiTextField).props().onRightIconClick();
|
46
|
-
assert.strictEqual(wrapper.state().showText, false);
|
47
|
-
});
|
48
|
-
it('should have placeholder prop to HiInput', function () {
|
49
|
-
assert.strictEqual(wrapper.find(HiTextField).dive().find(HiInput).props().placeholder, '');
|
50
|
-
wrapper.setProps({
|
51
|
-
HiInputProps: {
|
52
|
-
placeholder: 'Password'
|
53
|
-
}
|
54
|
-
});
|
55
|
-
wrapper.update();
|
56
|
-
assert.strictEqual(wrapper.find(HiTextField).dive().find(HiInput).props().placeholder, 'Password');
|
57
|
-
});
|
58
|
-
});
|
59
|
-
});
|
60
|
-
});
|
@@ -1,193 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { spy } from 'sinon';
|
4
|
-
import { createShallow, createMount } from '../test-utils';
|
5
|
-
import HiSearchField from './HiSearchField';
|
6
|
-
describe('<HiSearchField />', function () {
|
7
|
-
var shallow;
|
8
|
-
var mount;
|
9
|
-
before(function () {
|
10
|
-
shallow = createShallow({
|
11
|
-
untilSelector: 'HiSearchField'
|
12
|
-
});
|
13
|
-
});
|
14
|
-
beforeEach(function () {
|
15
|
-
mount = createMount();
|
16
|
-
});
|
17
|
-
after(function () {
|
18
|
-
mount.cleanUp();
|
19
|
-
});
|
20
|
-
it('should render a <div />', function () {
|
21
|
-
var wrapper = shallow(React.createElement(HiSearchField, {
|
22
|
-
itemList: [],
|
23
|
-
onFilteredList: function onFilteredList() {
|
24
|
-
return null;
|
25
|
-
}
|
26
|
-
}));
|
27
|
-
assert.strictEqual(wrapper.name(), 'div');
|
28
|
-
});
|
29
|
-
it('should render an <input /> inside the div', function () {
|
30
|
-
var wrapper = mount(React.createElement(HiSearchField, {
|
31
|
-
itemList: [],
|
32
|
-
onFilteredList: function onFilteredList() {
|
33
|
-
return null;
|
34
|
-
}
|
35
|
-
}));
|
36
|
-
var input = wrapper.find('input');
|
37
|
-
assert.strictEqual(input.name(), 'input');
|
38
|
-
assert.strictEqual(input.props().type, 'text', 'should pass the text type prop');
|
39
|
-
});
|
40
|
-
it('should fire onChange event callbacks', function () {
|
41
|
-
var handleChange = spy();
|
42
|
-
var wrapper = mount(React.createElement(HiSearchField, {
|
43
|
-
itemList: [],
|
44
|
-
onFilteredList: handleChange
|
45
|
-
}));
|
46
|
-
wrapper.find('input').simulate('change');
|
47
|
-
assert.strictEqual(handleChange.calledOnce, true, 'should have called the callback');
|
48
|
-
});
|
49
|
-
it('should fire onChange event callbacks and call onSearch', function () {
|
50
|
-
var handleChange = spy();
|
51
|
-
var onSearch = spy();
|
52
|
-
var wrapper = mount(React.createElement(HiSearchField, {
|
53
|
-
itemList: [],
|
54
|
-
onFilteredList: handleChange,
|
55
|
-
onSearch: onSearch
|
56
|
-
}));
|
57
|
-
wrapper.find('input').simulate('change', 'value');
|
58
|
-
assert.strictEqual(onSearch.calledOnce, true, 'should have called the callback');
|
59
|
-
});
|
60
|
-
it('should handle flatten array', function () {
|
61
|
-
var handleChange = spy();
|
62
|
-
var itemList = ['zizou', 'zizou', 'manu'];
|
63
|
-
var wrapper = mount(React.createElement(HiSearchField, {
|
64
|
-
itemList: itemList,
|
65
|
-
onFilteredList: handleChange
|
66
|
-
}));
|
67
|
-
wrapper.find('input').simulate('change');
|
68
|
-
assert.strictEqual(handleChange.calledOnce, true, 'should have called the callback');
|
69
|
-
});
|
70
|
-
it('should handle nested array', function () {
|
71
|
-
var handleChange = spy();
|
72
|
-
var itemList = [{
|
73
|
-
id: 'zz',
|
74
|
-
label: 'Zizou'
|
75
|
-
}, {
|
76
|
-
id: 'zze',
|
77
|
-
label: 'Zizou encore'
|
78
|
-
}, {
|
79
|
-
id: 'ep',
|
80
|
-
label: 'Emmanuel Petit'
|
81
|
-
}];
|
82
|
-
var wrapper = mount(React.createElement(HiSearchField, {
|
83
|
-
itemList: itemList,
|
84
|
-
onFilteredList: handleChange,
|
85
|
-
filterPropertyList: ['label']
|
86
|
-
}));
|
87
|
-
wrapper.find('input').simulate('change');
|
88
|
-
assert.strictEqual(handleChange.calledOnce, true, 'should have called the callback');
|
89
|
-
});
|
90
|
-
it('should handle double nested array', function () {
|
91
|
-
var handleChange = spy();
|
92
|
-
var itemList = [{
|
93
|
-
id: 'zz',
|
94
|
-
record: {
|
95
|
-
label: 'Zizou'
|
96
|
-
}
|
97
|
-
}, {
|
98
|
-
id: 'zze',
|
99
|
-
record: {
|
100
|
-
label: 'Zizou encore'
|
101
|
-
}
|
102
|
-
}, {
|
103
|
-
id: 'ep',
|
104
|
-
record: {
|
105
|
-
label: 'Emmanuel Petit'
|
106
|
-
}
|
107
|
-
}];
|
108
|
-
var wrapper = mount(React.createElement(HiSearchField, {
|
109
|
-
itemList: itemList,
|
110
|
-
onFilteredList: handleChange,
|
111
|
-
filterPropertyList: ['record.label']
|
112
|
-
}));
|
113
|
-
wrapper.find('input').simulate('change');
|
114
|
-
assert.strictEqual(handleChange.calledOnce, true, 'should have called the callback');
|
115
|
-
});
|
116
|
-
it('should return filtered list on search value and add reset button', function () {
|
117
|
-
var itemList = [{
|
118
|
-
id: 'zz',
|
119
|
-
label: 'Zizou'
|
120
|
-
}, {
|
121
|
-
id: 'zze',
|
122
|
-
label: 'Zizou encore'
|
123
|
-
}, {
|
124
|
-
id: 'ep',
|
125
|
-
label: 'Emmanuel Petit'
|
126
|
-
}];
|
127
|
-
var searchValue = 'peTit';
|
128
|
-
var expectedFilteredItemList = [{
|
129
|
-
id: 'ep',
|
130
|
-
label: 'Emmanuel Petit'
|
131
|
-
}];
|
132
|
-
var handleChange = spy();
|
133
|
-
var wrapper = mount(React.createElement(HiSearchField, {
|
134
|
-
itemList: itemList,
|
135
|
-
onFilteredList: handleChange,
|
136
|
-
filterPropertyList: ['label']
|
137
|
-
})); // Fill input
|
138
|
-
|
139
|
-
var event = {
|
140
|
-
target: {
|
141
|
-
value: searchValue
|
142
|
-
}
|
143
|
-
};
|
144
|
-
wrapper.find('input').simulate('change', event);
|
145
|
-
assert.strictEqual(handleChange.calledWith(expectedFilteredItemList), true, 'should have called the callback with filtered item list');
|
146
|
-
assert.strictEqual(handleChange.calledWith(itemList), false, 'should not have called yet the callback with full item list');
|
147
|
-
assert.strictEqual(wrapper.find('button').length, 0, 'should not have clear icon');
|
148
|
-
wrapper.find('input').simulate('focus');
|
149
|
-
var resetButton = wrapper.find('button');
|
150
|
-
assert.strictEqual(resetButton.name(), 'button', 'should have reset button');
|
151
|
-
wrapper.find('button').simulate('click'); // Click on reset
|
152
|
-
|
153
|
-
resetButton.simulate('click');
|
154
|
-
assert.strictEqual(handleChange.calledWith(itemList), true, 'should not have called the callback with full item list');
|
155
|
-
assert.strictEqual(handleChange.callCount, 3, 'should have called the callback three times');
|
156
|
-
});
|
157
|
-
it('should return filtered list on search value and add reset button call onSearch', function () {
|
158
|
-
var itemList = [{
|
159
|
-
id: 'zz',
|
160
|
-
label: 'Zizou'
|
161
|
-
}, {
|
162
|
-
id: 'zze',
|
163
|
-
label: 'Zizou encore'
|
164
|
-
}, {
|
165
|
-
id: 'ep',
|
166
|
-
label: 'Emmanuel Petit'
|
167
|
-
}];
|
168
|
-
var searchValue = 'peTit';
|
169
|
-
var handleChange = spy();
|
170
|
-
var onSearch = spy();
|
171
|
-
var wrapper = mount(React.createElement(HiSearchField, {
|
172
|
-
itemList: itemList,
|
173
|
-
onFilteredList: handleChange,
|
174
|
-
filterPropertyList: ['label'],
|
175
|
-
onSearch: onSearch
|
176
|
-
})); // Fill input
|
177
|
-
|
178
|
-
var event = {
|
179
|
-
target: {
|
180
|
-
value: searchValue
|
181
|
-
}
|
182
|
-
};
|
183
|
-
wrapper.find('input').simulate('change', event);
|
184
|
-
assert.strictEqual(handleChange.calledWith(itemList), false, 'should not have called yet the callback with full item list');
|
185
|
-
assert.strictEqual(wrapper.find('button').length, 0, 'should not have clear icon');
|
186
|
-
wrapper.find('input').simulate('focus');
|
187
|
-
var resetButton = wrapper.find('button');
|
188
|
-
assert.strictEqual(resetButton.name(), 'button', 'should have reset button'); // Click on reset
|
189
|
-
|
190
|
-
resetButton.simulate('click', 'reset');
|
191
|
-
assert.strictEqual(onSearch.callCount, 2, 'should have called the callback two times');
|
192
|
-
});
|
193
|
-
});
|
@@ -1,99 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert, expect } from 'chai';
|
3
|
-
import { spy } from 'sinon';
|
4
|
-
import { createShallow, createMount } from '../test-utils';
|
5
|
-
import HiSlider from './HiSlider';
|
6
|
-
import HiFormControl from './HiFormControl';
|
7
|
-
describe('<HiSlider />', function () {
|
8
|
-
var shallow;
|
9
|
-
var mount;
|
10
|
-
before(function () {
|
11
|
-
shallow = createShallow();
|
12
|
-
});
|
13
|
-
beforeEach(function () {
|
14
|
-
mount = createMount();
|
15
|
-
});
|
16
|
-
afterEach(function () {
|
17
|
-
mount.cleanUp();
|
18
|
-
});
|
19
|
-
describe('shallow', function () {
|
20
|
-
var wrapper;
|
21
|
-
var props = {
|
22
|
-
min: 0,
|
23
|
-
max: 100,
|
24
|
-
id: 'slider',
|
25
|
-
label: 'label'
|
26
|
-
};
|
27
|
-
beforeEach(function () {
|
28
|
-
wrapper = shallow(React.createElement(HiSlider, props), {
|
29
|
-
disableLifecycleMethods: true
|
30
|
-
});
|
31
|
-
});
|
32
|
-
it('should be a HiSlider', function () {
|
33
|
-
assert.strictEqual(wrapper.name(), 'HiSlider');
|
34
|
-
});
|
35
|
-
it('should have an HiFormControl as the only child', function () {
|
36
|
-
assert.strictEqual(wrapper.dive().children().length, 1);
|
37
|
-
assert.strictEqual(wrapper.dive().type(), HiFormControl);
|
38
|
-
});
|
39
|
-
it('should pass label to the HiFormControl', function () {
|
40
|
-
assert.strictEqual(wrapper.dive().find(HiFormControl).dive().props().label, props.label, '');
|
41
|
-
});
|
42
|
-
it('should show labels (right and left) if passed', function () {
|
43
|
-
assert.strictEqual(wrapper.dive().children().childAt(1).childAt(0).childAt(0).text(), '', 'should be empty because no left label is given in props');
|
44
|
-
assert.strictEqual(wrapper.dive().children().childAt(1).childAt(0).childAt(2).text(), '', 'should be empty because no right label is given in props');
|
45
|
-
var rightLabel = 'label right';
|
46
|
-
var leftLabel = 'label left';
|
47
|
-
wrapper.setProps({
|
48
|
-
rightLabel: rightLabel
|
49
|
-
});
|
50
|
-
wrapper.setProps({
|
51
|
-
leftLabel: leftLabel
|
52
|
-
});
|
53
|
-
assert.strictEqual(wrapper.dive().children().childAt(1).childAt(0).childAt(0).text(), leftLabel, 'should display the left label given in props');
|
54
|
-
assert.strictEqual(wrapper.dive().children().childAt(1).childAt(0).childAt(2).text(), rightLabel, 'should display the right label given in props');
|
55
|
-
});
|
56
|
-
it('should have the values given in props for max and min', function () {
|
57
|
-
assert.strictEqual(wrapper.dive().children().childAt(0).text(), '0', 'should be equal to the min value given in props');
|
58
|
-
assert.strictEqual(wrapper.dive().children().childAt(2).text(), '100', 'should be equal to the max value given in props');
|
59
|
-
});
|
60
|
-
it('should be on the initial value, then change', function () {
|
61
|
-
wrapper = shallow(React.createElement(HiSlider, {
|
62
|
-
id: 'slider',
|
63
|
-
min: 0,
|
64
|
-
max: 100,
|
65
|
-
value: 50
|
66
|
-
}), {
|
67
|
-
disableLifecycleMethods: true
|
68
|
-
});
|
69
|
-
assert.strictEqual(wrapper.dive().find('input').props().value, 50, 'the input value should be equal to initial value');
|
70
|
-
assert.strictEqual(wrapper.dive().children().childAt(1).childAt(0).childAt(1).text(), '50', 'the value shown to the user is the same as the initial value');
|
71
|
-
expect(wrapper.dive().children().childAt(1).childAt(1).props().style.background).to.include('50%');
|
72
|
-
});
|
73
|
-
});
|
74
|
-
it('should fire onChange event callbacks', function () {
|
75
|
-
var handleChange = spy();
|
76
|
-
var wrapper = mount(React.createElement(HiSlider, {
|
77
|
-
id: 'slider',
|
78
|
-
min: 0,
|
79
|
-
max: 100,
|
80
|
-
onChange: handleChange
|
81
|
-
}));
|
82
|
-
wrapper.find('input').simulate('change');
|
83
|
-
assert.strictEqual(handleChange.calledOnce, true, 'should have called the callback');
|
84
|
-
});
|
85
|
-
it('should be focused after onFocus, then not focused after onBlur', function () {
|
86
|
-
var wrapper = mount(shallow(React.createElement(HiSlider, {
|
87
|
-
id: 'slider',
|
88
|
-
rightLabel: 'test right',
|
89
|
-
leftLabel: 'test left',
|
90
|
-
min: 0,
|
91
|
-
max: 100,
|
92
|
-
value: 50
|
93
|
-
})).get(0));
|
94
|
-
wrapper.find(HiFormControl).prop('onFocus')();
|
95
|
-
assert.strictEqual(wrapper.state().focused, true, 'should be focused');
|
96
|
-
wrapper.find(HiFormControl).prop('onBlur')();
|
97
|
-
assert.strictEqual(wrapper.state().focused, false, 'should not be focused');
|
98
|
-
});
|
99
|
-
});
|
@@ -1,254 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { spy } from 'sinon';
|
4
|
-
import { createShallow, createMount } from '../test-utils';
|
5
|
-
import Warning from '@material-ui/icons/Warning';
|
6
|
-
import Info from '@material-ui/icons/Info';
|
7
|
-
import HiTextField from './HiTextField';
|
8
|
-
import HiInput from './HiInput';
|
9
|
-
describe('<HiTextField />', function () {
|
10
|
-
var shallow;
|
11
|
-
var mount;
|
12
|
-
before(function () {
|
13
|
-
shallow = createShallow({
|
14
|
-
dive: true
|
15
|
-
});
|
16
|
-
});
|
17
|
-
beforeEach(function () {
|
18
|
-
mount = createMount();
|
19
|
-
});
|
20
|
-
afterEach(function () {
|
21
|
-
mount.cleanUp();
|
22
|
-
});
|
23
|
-
describe('shallow', function () {
|
24
|
-
var wrapper;
|
25
|
-
beforeEach(function () {
|
26
|
-
wrapper = shallow(React.createElement(HiTextField, {
|
27
|
-
id: "text",
|
28
|
-
HiInputProps: {
|
29
|
-
name: 'testName',
|
30
|
-
startAdornment: 'Archive',
|
31
|
-
className: 'fullWidth'
|
32
|
-
}
|
33
|
-
}));
|
34
|
-
});
|
35
|
-
describe('shallow', function () {
|
36
|
-
it('should be a FormControl', function () {
|
37
|
-
assert.strictEqual(wrapper.name(), 'HiFormControl');
|
38
|
-
assert.strictEqual(wrapper.dive().name(), 'WithStyles(FormControl)');
|
39
|
-
});
|
40
|
-
it('should have initial props', function () {
|
41
|
-
assert.strictEqual(wrapper.props().error, false);
|
42
|
-
assert.strictEqual(wrapper.childAt(0).props().error, false);
|
43
|
-
});
|
44
|
-
it('should pass className to the FormControl', function () {
|
45
|
-
wrapper.setProps({
|
46
|
-
className: 'foo'
|
47
|
-
});
|
48
|
-
assert.strictEqual(wrapper.dive().hasClass('foo'), true);
|
49
|
-
});
|
50
|
-
it('should have an HiInput as the only child', function () {
|
51
|
-
assert.strictEqual(wrapper.children().length, 1);
|
52
|
-
assert.strictEqual(wrapper.childAt(0).type(), HiInput);
|
53
|
-
});
|
54
|
-
it('should forward the error prop to Input', function () {
|
55
|
-
wrapper = shallow(React.createElement(HiTextField, {
|
56
|
-
id: "text",
|
57
|
-
error: true
|
58
|
-
}));
|
59
|
-
assert.strictEqual(wrapper.childAt(0).props().error, true);
|
60
|
-
});
|
61
|
-
it('should forward the fullWidth prop to FormControl', function () {
|
62
|
-
wrapper = shallow(React.createElement(HiTextField, {
|
63
|
-
id: "text",
|
64
|
-
fullWidth: true
|
65
|
-
}));
|
66
|
-
assert.strictEqual(wrapper.props().fullWidth, true);
|
67
|
-
});
|
68
|
-
it('should pass HiInputProps to the HiInput', function () {
|
69
|
-
assert.strictEqual(wrapper.find(HiInput).props().startAdornment, 'Archive');
|
70
|
-
});
|
71
|
-
it('should apply additional properties to the Input component', function () {
|
72
|
-
wrapper.setProps({
|
73
|
-
HiInputProps: {
|
74
|
-
className: 'fullWidth'
|
75
|
-
}
|
76
|
-
});
|
77
|
-
assert.strictEqual(wrapper.find(HiInput).props().className, 'fullWidth');
|
78
|
-
});
|
79
|
-
});
|
80
|
-
describe('with a label', function () {
|
81
|
-
beforeEach(function () {
|
82
|
-
wrapper.setProps({
|
83
|
-
label: 'Foo bar'
|
84
|
-
});
|
85
|
-
});
|
86
|
-
it('should have 1 child', function () {
|
87
|
-
assert.strictEqual(wrapper.children().length, 1);
|
88
|
-
});
|
89
|
-
it('should have an HiInput as the first child', function () {
|
90
|
-
assert.strictEqual(wrapper.childAt(0).type(), HiInput);
|
91
|
-
});
|
92
|
-
});
|
93
|
-
describe('with a helper text', function () {
|
94
|
-
beforeEach(function () {
|
95
|
-
wrapper.setProps({
|
96
|
-
helperText: 'Foo bar'
|
97
|
-
});
|
98
|
-
});
|
99
|
-
it('should have 1 child', function () {
|
100
|
-
assert.strictEqual(wrapper.children().length, 1);
|
101
|
-
});
|
102
|
-
/* it('should have a FormHelperText as the second child', () => {
|
103
|
-
assert.strictEqual(wrapper.childAt(1).type(), FormHelperText);
|
104
|
-
}); */
|
105
|
-
|
106
|
-
it('should have an HiInput as the first child', function () {
|
107
|
-
assert.strictEqual(wrapper.childAt(0).type(), HiInput);
|
108
|
-
});
|
109
|
-
});
|
110
|
-
});
|
111
|
-
describe('mount', function () {
|
112
|
-
var wrapper;
|
113
|
-
var handleChange = spy();
|
114
|
-
var handleReset = spy();
|
115
|
-
var handleBlur = spy();
|
116
|
-
var handleFocus = spy();
|
117
|
-
describe('callbacks', function () {
|
118
|
-
it('should be called', function () {
|
119
|
-
wrapper = mount(React.createElement(HiTextField, {
|
120
|
-
id: "text",
|
121
|
-
onChange: handleChange,
|
122
|
-
onReset: handleReset,
|
123
|
-
onBlur: handleBlur,
|
124
|
-
onFocus: handleFocus,
|
125
|
-
value: "defaultValue",
|
126
|
-
helperText: "helper",
|
127
|
-
maxLength: 20
|
128
|
-
}));
|
129
|
-
wrapper.find('input').simulate('change', {
|
130
|
-
target: {
|
131
|
-
value: 'newValue'
|
132
|
-
}
|
133
|
-
});
|
134
|
-
assert.strictEqual(handleChange.callCount, 1, 'should trigger change callback');
|
135
|
-
assert.strictEqual(handleChange.args[0][0].target.value, 'newValue');
|
136
|
-
assert.strictEqual(wrapper.state().nbChars, 12);
|
137
|
-
wrapper.find('input').simulate('change', {
|
138
|
-
target: {
|
139
|
-
value: '1234567890123456789012345'
|
140
|
-
}
|
141
|
-
});
|
142
|
-
assert.strictEqual(handleChange.callCount, 1, 'should not trigger change callback');
|
143
|
-
assert.strictEqual(wrapper.state().nbChars, 12);
|
144
|
-
wrapper.find('input').simulate('focus');
|
145
|
-
assert.strictEqual(handleFocus.callCount, 1, 'should trigger focus callback');
|
146
|
-
wrapper.find('button').simulate('click');
|
147
|
-
assert.strictEqual(handleReset.callCount, 1, 'should trigger reset callback');
|
148
|
-
wrapper.find('input').simulate('blur');
|
149
|
-
assert.strictEqual(handleBlur.callCount, 1, 'should trigger blur callback');
|
150
|
-
});
|
151
|
-
});
|
152
|
-
describe('without callbacks (for 100% Branch coverage', function () {
|
153
|
-
it('should not be called', function () {
|
154
|
-
wrapper = mount(React.createElement(HiTextField, {
|
155
|
-
id: "text",
|
156
|
-
value: "defaultValue",
|
157
|
-
label: "label",
|
158
|
-
helperText: "My helper",
|
159
|
-
helperIcon: true,
|
160
|
-
onReset: function onReset() {}
|
161
|
-
}));
|
162
|
-
wrapper.find('input').simulate('change', {
|
163
|
-
target: {
|
164
|
-
value: 'newValue'
|
165
|
-
}
|
166
|
-
});
|
167
|
-
assert.strictEqual(wrapper.find('button').length, 1, 'should not have clear icon');
|
168
|
-
wrapper.find('input').simulate('focus');
|
169
|
-
assert.strictEqual(wrapper.find('button').length, 2, 'should not have clear icon');
|
170
|
-
wrapper.find('button').at(1).simulate('click');
|
171
|
-
wrapper.find('input').simulate('blur');
|
172
|
-
});
|
173
|
-
});
|
174
|
-
describe('helpers', function () {
|
175
|
-
it('should be displayed', function () {
|
176
|
-
wrapper = mount(React.createElement(HiTextField, {
|
177
|
-
id: "text",
|
178
|
-
onChange: handleChange,
|
179
|
-
onReset: handleReset,
|
180
|
-
onBlur: handleBlur,
|
181
|
-
onFocus: handleFocus,
|
182
|
-
value: "defaultValue",
|
183
|
-
helperText: "helper",
|
184
|
-
maxLength: 20
|
185
|
-
}));
|
186
|
-
assert.strictEqual(wrapper.find('p').text(), 'helper', 'Should render helper');
|
187
|
-
});
|
188
|
-
});
|
189
|
-
describe('helpers', function () {
|
190
|
-
it('should be displayed', function () {
|
191
|
-
wrapper = mount(React.createElement(HiTextField, {
|
192
|
-
id: "text",
|
193
|
-
value: "defaultValue",
|
194
|
-
label: "label",
|
195
|
-
helperText: "My helper",
|
196
|
-
helperIcon: true
|
197
|
-
}));
|
198
|
-
assert.strictEqual(wrapper.find('p').length, 0, 'Should not have helper p');
|
199
|
-
assert.strictEqual(wrapper.find(Info).length, 1, 'Should have helper icon');
|
200
|
-
assert.strictEqual(wrapper.childAt(0).text(), 'label', 'First child should be the label');
|
201
|
-
var helperIcon = wrapper.find(Info);
|
202
|
-
helperIcon.simulate('click');
|
203
|
-
assert.strictEqual(wrapper.childAt(0).text(), 'My helperlabel', 'First child should be the helper div');
|
204
|
-
});
|
205
|
-
});
|
206
|
-
describe('errors', function () {
|
207
|
-
it('should be displayed', function () {
|
208
|
-
wrapper = mount(React.createElement(HiTextField, {
|
209
|
-
id: "text",
|
210
|
-
value: "defaultValue",
|
211
|
-
label: "label",
|
212
|
-
error: true,
|
213
|
-
errorText: "My error"
|
214
|
-
}));
|
215
|
-
assert.strictEqual(wrapper.find('p').length, 0, 'Should not have error p');
|
216
|
-
assert.strictEqual(wrapper.find(Warning).length, 1, 'Should have error icon');
|
217
|
-
assert.strictEqual(wrapper.childAt(0).text(), 'label', 'First child should be the label');
|
218
|
-
var errorIcon = wrapper.find(Warning);
|
219
|
-
errorIcon.simulate('click');
|
220
|
-
assert.strictEqual(wrapper.childAt(0).text(), 'My errorlabel', 'First child should be the error div');
|
221
|
-
});
|
222
|
-
});
|
223
|
-
describe('state with multiline', function () {
|
224
|
-
it('should be good', function () {
|
225
|
-
var handleChange1 = spy();
|
226
|
-
wrapper = mount(React.createElement(HiTextField, {
|
227
|
-
id: "text",
|
228
|
-
onChange: handleChange1,
|
229
|
-
value: "defaultValue",
|
230
|
-
multiline: true
|
231
|
-
}));
|
232
|
-
assert.strictEqual(wrapper.state().nbChars, 12);
|
233
|
-
wrapper.find('textarea').first().simulate('change', {
|
234
|
-
target: {
|
235
|
-
value: 'newValue'
|
236
|
-
}
|
237
|
-
});
|
238
|
-
wrapper.find('textarea').at(1).simulate('change', {
|
239
|
-
target: {
|
240
|
-
value: 'newValue'
|
241
|
-
}
|
242
|
-
});
|
243
|
-
wrapper.find('textarea').at(2).simulate('change', {
|
244
|
-
target: {
|
245
|
-
value: 'newValue'
|
246
|
-
}
|
247
|
-
});
|
248
|
-
assert.strictEqual(handleChange1.callCount, 1, 'should trigger change callback');
|
249
|
-
assert.strictEqual(handleChange1.args[0][0].target.value, 'newValue');
|
250
|
-
assert.strictEqual(wrapper.state().nbChars, 8);
|
251
|
-
});
|
252
|
-
});
|
253
|
-
});
|
254
|
-
});
|