@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,90 +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 HiDotsStepper from './HiDotsStepper';
|
6
|
-
import HiDot from './HiDot';
|
7
|
-
describe('<HiDotsStepper />', function () {
|
8
|
-
var shallow;
|
9
|
-
var mount;
|
10
|
-
var wrapper;
|
11
|
-
var props = {
|
12
|
-
steps: [{
|
13
|
-
id: 0,
|
14
|
-
status: 'validated'
|
15
|
-
}, {
|
16
|
-
id: 1,
|
17
|
-
status: 'unreviewed'
|
18
|
-
}, {
|
19
|
-
id: 2,
|
20
|
-
status: 'refused'
|
21
|
-
}],
|
22
|
-
activeStep: 0
|
23
|
-
};
|
24
|
-
before(function () {
|
25
|
-
shallow = createShallow();
|
26
|
-
});
|
27
|
-
beforeEach(function () {
|
28
|
-
mount = createMount();
|
29
|
-
});
|
30
|
-
afterEach(function () {
|
31
|
-
mount.cleanUp();
|
32
|
-
});
|
33
|
-
describe('Working onClick & onNavigation callbacks', function () {
|
34
|
-
it('should test onClick callbacks', function () {
|
35
|
-
var handleChange = spy();
|
36
|
-
wrapper = shallow(React.createElement(HiDotsStepper, Object.assign({}, props, {
|
37
|
-
onChange: handleChange
|
38
|
-
})));
|
39
|
-
wrapper.dive().find(HiDot).at(1).props().onClick();
|
40
|
-
assert.strictEqual(handleChange.calledOnce, true);
|
41
|
-
assert.strictEqual(handleChange.calledWith(1), true);
|
42
|
-
});
|
43
|
-
it('should test onNavigation callbacks', function () {
|
44
|
-
var handleChange = spy();
|
45
|
-
wrapper = mount(React.createElement(HiDotsStepper, Object.assign({}, props, {
|
46
|
-
onChange: handleChange
|
47
|
-
})));
|
48
|
-
wrapper.find('button').at(0).simulate('focus'); // Active step = 0
|
49
|
-
// -> = 1
|
50
|
-
|
51
|
-
wrapper.find('div[role="presentation"]').at(0).simulate('keyDown', {
|
52
|
-
key: 'ArrowRight'
|
53
|
-
});
|
54
|
-
assert.strictEqual(handleChange.calledOnce, true);
|
55
|
-
assert.strictEqual(handleChange.calledWith(1), true); // <- = 2
|
56
|
-
|
57
|
-
wrapper.find('div[role="presentation"]').at(0).simulate('keyDown', {
|
58
|
-
key: 'ArrowLeft'
|
59
|
-
});
|
60
|
-
assert.strictEqual(handleChange.calledTwice, true);
|
61
|
-
assert.strictEqual(handleChange.calledWith(2), true); // Active step = 2
|
62
|
-
|
63
|
-
wrapper.setProps({
|
64
|
-
activeStep: 2
|
65
|
-
});
|
66
|
-
wrapper.update();
|
67
|
-
wrapper.find('button').at(2).simulate('focus'); // -> = 1
|
68
|
-
|
69
|
-
wrapper.find('div[role="presentation"]').at(0).simulate('keyDown', {
|
70
|
-
key: 'ArrowRight'
|
71
|
-
});
|
72
|
-
assert.strictEqual(handleChange.calledThrice, true);
|
73
|
-
assert.strictEqual(handleChange.calledWith(1), true); // <- = 1
|
74
|
-
|
75
|
-
wrapper.find('div[role="presentation"]').at(0).simulate('keyDown', {
|
76
|
-
key: 'ArrowLeft'
|
77
|
-
});
|
78
|
-
assert.strictEqual(handleChange.callCount, 4);
|
79
|
-
assert.strictEqual(handleChange.calledWith(1), true);
|
80
|
-
});
|
81
|
-
});
|
82
|
-
describe('mount', function () {
|
83
|
-
describe('callbacks', function () {
|
84
|
-
it('should instanciate correctly', function () {
|
85
|
-
wrapper = mount(React.createElement(HiDotsStepper, props));
|
86
|
-
assert.instanceOf(wrapper.instance(), HiDotsStepper);
|
87
|
-
});
|
88
|
-
});
|
89
|
-
});
|
90
|
-
});
|
@@ -1,79 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { spy } from 'sinon';
|
4
|
-
import { createShallow } from '../test-utils';
|
5
|
-
import HiAddressField from './HiAddressField';
|
6
|
-
import HiSuggestSelectField from '../HiSelect/HiSuggestSelectField';
|
7
|
-
import HiSuggestSelect from '../HiSelect/HiSuggestSelect';
|
8
|
-
|
9
|
-
require('isomorphic-fetch'); // pour la méthode fetch()
|
10
|
-
|
11
|
-
|
12
|
-
describe('<HiAddressField />', function () {
|
13
|
-
var shallow;
|
14
|
-
before(function () {
|
15
|
-
shallow = createShallow();
|
16
|
-
});
|
17
|
-
it('should render HiAddressField', function () {
|
18
|
-
var handler = spy();
|
19
|
-
var wrapper = shallow(React.createElement(HiAddressField, {
|
20
|
-
onSearch: handler
|
21
|
-
}), {
|
22
|
-
disableLifecycleMethods: true
|
23
|
-
});
|
24
|
-
var fakeEvent = {
|
25
|
-
target: {
|
26
|
-
value: 'search'
|
27
|
-
}
|
28
|
-
};
|
29
|
-
wrapper.find(HiSuggestSelectField).props().onSearch(fakeEvent);
|
30
|
-
assert.strictEqual(handler.calledOnce, true, 'should have been called once.');
|
31
|
-
assert.strictEqual(handler.calledWith(fakeEvent), true, 'should have been called with "search".');
|
32
|
-
});
|
33
|
-
it('should reset HiAddressField', function () {
|
34
|
-
var handler = spy();
|
35
|
-
var wrapper = shallow(React.createElement(HiAddressField, {
|
36
|
-
onReset: handler
|
37
|
-
}), {
|
38
|
-
disableLifecycleMethods: true
|
39
|
-
});
|
40
|
-
wrapper.setState({
|
41
|
-
isExact: true,
|
42
|
-
options: ['not_empty']
|
43
|
-
});
|
44
|
-
wrapper.find(HiSuggestSelectField).props().onReset();
|
45
|
-
assert.strictEqual(handler.calledOnce, true, 'should have been called once.');
|
46
|
-
wrapper.update();
|
47
|
-
assert.strictEqual(wrapper.props().isExact, false, 'should not be exact after reset');
|
48
|
-
assert.strictEqual(wrapper.find(HiSuggestSelectField).dive().find(HiSuggestSelect).props().options.length, 0, 'should have been emptied');
|
49
|
-
});
|
50
|
-
it('should select a value for HiAddressField', function () {
|
51
|
-
var handler = spy();
|
52
|
-
var wrapper = shallow(React.createElement(HiAddressField, {
|
53
|
-
onSelect: handler
|
54
|
-
}), {
|
55
|
-
disableLifecycleMethods: true
|
56
|
-
});
|
57
|
-
var fakeEvent = {};
|
58
|
-
var fakeTextValue = 'test';
|
59
|
-
var fakeValue = {
|
60
|
-
label: fakeTextValue
|
61
|
-
};
|
62
|
-
wrapper.find(HiSuggestSelectField).props().onSelect(fakeEvent, fakeValue);
|
63
|
-
wrapper.update();
|
64
|
-
assert.strictEqual(wrapper.props().isExact, true, 'should be exact after a proposition has been selected');
|
65
|
-
assert.strictEqual(wrapper.find(HiSuggestSelectField).dive().find(HiSuggestSelect).props().options.length, 0, 'should have been emptied');
|
66
|
-
});
|
67
|
-
it('should render a HiAddressField expecting a real address', function () {
|
68
|
-
var wrapper = shallow(React.createElement(HiAddressField, {
|
69
|
-
exactOnly: true
|
70
|
-
}), {
|
71
|
-
disableLifecycleMethods: true
|
72
|
-
});
|
73
|
-
assert.strictEqual(wrapper.find(HiSuggestSelectField).dive().props().error, true, 'should be on error.');
|
74
|
-
wrapper.setState({
|
75
|
-
isExact: true
|
76
|
-
});
|
77
|
-
assert.strictEqual(wrapper.find(HiSuggestSelectField).dive().props().error, false, 'should not be on error.');
|
78
|
-
});
|
79
|
-
});
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { createShallow } from '../test-utils';
|
4
|
-
import HiEmailField from './HiEmailField';
|
5
|
-
import HiTextField from './HiTextField';
|
6
|
-
describe('<HiEmailField />', function () {
|
7
|
-
var shallow;
|
8
|
-
before(function () {
|
9
|
-
shallow = createShallow({
|
10
|
-
dive: true
|
11
|
-
});
|
12
|
-
});
|
13
|
-
it('should render a <HiTextField />', function () {
|
14
|
-
var wrapper = shallow(React.createElement(HiEmailField, {
|
15
|
-
id: "test"
|
16
|
-
}));
|
17
|
-
assert.strictEqual(wrapper.find(HiTextField).length, 0, 'render HiTextField');
|
18
|
-
});
|
19
|
-
});
|
@@ -1,195 +0,0 @@
|
|
1
|
-
/* eslint-disable */
|
2
|
-
import React from 'react';
|
3
|
-
import { assert } from 'chai';
|
4
|
-
import { spy } from 'sinon';
|
5
|
-
import { createShallow, createMount } from '../test-utils';
|
6
|
-
import Info from '@material-ui/icons/Info';
|
7
|
-
import HiFormControl from './HiFormControl';
|
8
|
-
import HiIconButton from '../HiIconButton';
|
9
|
-
import HiFormLabel from './HiFormLabel';
|
10
|
-
import HiInput from './HiInput';
|
11
|
-
import FormControl from '@material-ui/core/FormControl';
|
12
|
-
import FormHelperText from '@material-ui/core/FormHelperText';
|
13
|
-
describe('<HiFormControl />', function () {
|
14
|
-
var shallow;
|
15
|
-
var mount;
|
16
|
-
before(function () {
|
17
|
-
shallow = createShallow({
|
18
|
-
dive: true
|
19
|
-
});
|
20
|
-
});
|
21
|
-
beforeEach(function () {
|
22
|
-
mount = createMount();
|
23
|
-
});
|
24
|
-
afterEach(function () {
|
25
|
-
mount.cleanUp();
|
26
|
-
});
|
27
|
-
describe('shallow', function () {
|
28
|
-
var wrapper;
|
29
|
-
beforeEach(function () {
|
30
|
-
wrapper = shallow(React.createElement(HiFormControl, null, React.createElement(HiInput, null)));
|
31
|
-
});
|
32
|
-
describe('structure', function () {
|
33
|
-
it('should be a FormControl', function () {
|
34
|
-
assert.strictEqual(wrapper.name(), 'WithStyles(FormControl)');
|
35
|
-
assert.strictEqual(wrapper.dive().name(), 'FormControl');
|
36
|
-
});
|
37
|
-
it('should have initial props', function () {
|
38
|
-
assert.strictEqual(wrapper.props().error, false);
|
39
|
-
});
|
40
|
-
it('should pass className to the FormControl', function () {
|
41
|
-
wrapper.setProps({
|
42
|
-
className: 'foo'
|
43
|
-
});
|
44
|
-
assert.strictEqual(wrapper.dive().hasClass('foo'), true);
|
45
|
-
});
|
46
|
-
it('should have one child', function () {
|
47
|
-
assert.strictEqual(wrapper.children().length, 1);
|
48
|
-
});
|
49
|
-
it('should forward the fullWidth prop to FormControl', function () {
|
50
|
-
wrapper = shallow(React.createElement(HiFormControl, {
|
51
|
-
fullWidth: true
|
52
|
-
}));
|
53
|
-
assert.strictEqual(wrapper.props().fullWidth, true);
|
54
|
-
});
|
55
|
-
it('should display help', function () {
|
56
|
-
assert.strictEqual(wrapper.state().helperOpen, false);
|
57
|
-
wrapper.setProps({
|
58
|
-
label: 'Label',
|
59
|
-
helperText: 'helper',
|
60
|
-
helperIcon: true
|
61
|
-
});
|
62
|
-
var helperIcon = wrapper.find(HiIconButton);
|
63
|
-
assert.strictEqual(wrapper.childAt(0).type(), HiFormLabel, 'helper div should not be here');
|
64
|
-
helperIcon.simulate('click');
|
65
|
-
assert.strictEqual(wrapper.state().helperOpen, true, 'helper should be open');
|
66
|
-
assert.strictEqual(wrapper.childAt(0).type(), 'div', 'helper div should be here');
|
67
|
-
});
|
68
|
-
});
|
69
|
-
describe('with a label', function () {
|
70
|
-
beforeEach(function () {
|
71
|
-
wrapper.setProps({
|
72
|
-
label: 'Foo bar'
|
73
|
-
});
|
74
|
-
});
|
75
|
-
it('should have 2 children', function () {
|
76
|
-
assert.strictEqual(wrapper.children().length, 2);
|
77
|
-
});
|
78
|
-
it('should have an HiFormLabel as the first child', function () {
|
79
|
-
assert.strictEqual(wrapper.childAt(0).type(), HiFormLabel);
|
80
|
-
});
|
81
|
-
it('should have a div as the second child', function () {
|
82
|
-
assert.strictEqual(wrapper.childAt(1).type(), 'div');
|
83
|
-
});
|
84
|
-
});
|
85
|
-
describe('with a helper text', function () {
|
86
|
-
beforeEach(function () {
|
87
|
-
wrapper.setProps({
|
88
|
-
helperText: 'Foo bar'
|
89
|
-
});
|
90
|
-
});
|
91
|
-
it('should have 2 children', function () {
|
92
|
-
assert.strictEqual(wrapper.children().length, 2);
|
93
|
-
});
|
94
|
-
it('should have a FormHelperText as the second child', function () {
|
95
|
-
assert.strictEqual(wrapper.childAt(1).type(), FormHelperText);
|
96
|
-
});
|
97
|
-
it('should have a div as the first child', function () {
|
98
|
-
assert.strictEqual(wrapper.childAt(0).type(), 'div');
|
99
|
-
});
|
100
|
-
});
|
101
|
-
describe('with a helper text', function () {
|
102
|
-
beforeEach(function () {
|
103
|
-
wrapper.setProps({
|
104
|
-
multiline: true
|
105
|
-
});
|
106
|
-
});
|
107
|
-
it('should have 2 children', function () {
|
108
|
-
assert.strictEqual(wrapper.children().length, 2);
|
109
|
-
});
|
110
|
-
});
|
111
|
-
});
|
112
|
-
describe('mount', function () {
|
113
|
-
var wrapper;
|
114
|
-
var handleBlur = spy();
|
115
|
-
var handleFocus = spy();
|
116
|
-
beforeEach(function () {
|
117
|
-
wrapper = mount(React.createElement(HiFormControl, {
|
118
|
-
onBlur: handleBlur,
|
119
|
-
onFocus: handleFocus,
|
120
|
-
helperText: "helper"
|
121
|
-
}));
|
122
|
-
});
|
123
|
-
describe('callbacks', function () {
|
124
|
-
it('should be called', function () {
|
125
|
-
wrapper.find(FormControl).simulate('focus');
|
126
|
-
assert.strictEqual(handleFocus.callCount, 1, 'should trigger focus callback');
|
127
|
-
wrapper.find(FormControl).simulate('blur');
|
128
|
-
assert.strictEqual(handleBlur.callCount, 1, 'should trigger blur callback');
|
129
|
-
});
|
130
|
-
});
|
131
|
-
describe('without callbacks (for 100% Branch coverage', function () {
|
132
|
-
it('should not be called', function () {
|
133
|
-
// wrapper = mount(
|
134
|
-
// <HiFormControl
|
135
|
-
// value="defaultValue"
|
136
|
-
// label="label"
|
137
|
-
// helperText="My helper"
|
138
|
-
// helperIcon
|
139
|
-
// />,
|
140
|
-
// );
|
141
|
-
wrapper.find(FormControl).simulate('blur');
|
142
|
-
});
|
143
|
-
});
|
144
|
-
describe('helpers', function () {
|
145
|
-
it('should be displayed', function () {
|
146
|
-
assert.strictEqual(wrapper.find('p').text(), 'helper', 'Should render helper');
|
147
|
-
});
|
148
|
-
});
|
149
|
-
describe('helpers on multiline', function () {
|
150
|
-
it('should be displayed', function () {
|
151
|
-
assert.strictEqual(wrapper.find('p').text(), 'helper', 'Should render helper');
|
152
|
-
});
|
153
|
-
it('should display nbChars/maxLength', function () {
|
154
|
-
wrapper.setProps({
|
155
|
-
multiline: true,
|
156
|
-
nbChars: 5,
|
157
|
-
maxLength: 200
|
158
|
-
});
|
159
|
-
assert.strictEqual(wrapper.find('p').text(), '5/200', 'Should render helper');
|
160
|
-
});
|
161
|
-
});
|
162
|
-
describe('helpers', function () {
|
163
|
-
it('should be displayed', function () {
|
164
|
-
wrapper.setProps({
|
165
|
-
helperIcon: true,
|
166
|
-
value: 'Default value',
|
167
|
-
label: 'label'
|
168
|
-
});
|
169
|
-
assert.strictEqual(wrapper.find('p').length, 0, 'Should not have helper p');
|
170
|
-
assert.strictEqual(wrapper.find(Info).length, 1, 'Should have helper icon');
|
171
|
-
assert.strictEqual(wrapper.childAt(0).text(), 'label', 'First child should be the label');
|
172
|
-
var helperIcon = wrapper.find(Info);
|
173
|
-
helperIcon.simulate('click');
|
174
|
-
assert.strictEqual(wrapper.childAt(0).text(), 'helperlabel', 'First child should be the helper div');
|
175
|
-
});
|
176
|
-
});
|
177
|
-
describe('errors', function () {
|
178
|
-
it('should be displayed', function () {
|
179
|
-
wrapper.unmount();
|
180
|
-
wrapper = mount(React.createElement(HiFormControl, {
|
181
|
-
value: "defaultValue",
|
182
|
-
label: "label",
|
183
|
-
error: true,
|
184
|
-
errorText: "My error"
|
185
|
-
}));
|
186
|
-
assert.strictEqual(wrapper.find('p').length, 0, 'Should not have error p');
|
187
|
-
assert.strictEqual(wrapper.find(HiIconButton).length, 1, 'Should have error icon');
|
188
|
-
assert.strictEqual(wrapper.childAt(0).text(), 'label', 'First child should be the label');
|
189
|
-
var errorIcon = wrapper.find(HiIconButton);
|
190
|
-
errorIcon.simulate('click');
|
191
|
-
assert.strictEqual(wrapper.childAt(0).text(), 'My errorlabel', 'First child should be the error div');
|
192
|
-
});
|
193
|
-
});
|
194
|
-
});
|
195
|
-
});
|
@@ -1,66 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { createShallow, createMount } from '../test-utils';
|
4
|
-
import HiFormLabel from './HiFormLabel';
|
5
|
-
describe('<HiFormLabel />', function () {
|
6
|
-
var shallow;
|
7
|
-
var mount;
|
8
|
-
before(function () {
|
9
|
-
shallow = createShallow({
|
10
|
-
dive: true
|
11
|
-
});
|
12
|
-
});
|
13
|
-
beforeEach(function () {
|
14
|
-
mount = createMount();
|
15
|
-
});
|
16
|
-
afterEach(function () {
|
17
|
-
mount.cleanUp();
|
18
|
-
});
|
19
|
-
it('should render a label', function () {
|
20
|
-
var wrapper = mount(React.createElement(HiFormLabel, {
|
21
|
-
label: "Test"
|
22
|
-
}));
|
23
|
-
assert.strictEqual(wrapper.find(HiFormLabel).length, 1, 'Should render 1 HiFormLabel');
|
24
|
-
assert.strictEqual(wrapper.find(HiFormLabel).find('label').length, 1, 'Should render 1 label');
|
25
|
-
assert.strictEqual(wrapper.find(HiFormLabel).find('label').text(), 'Test', 'Should render label');
|
26
|
-
wrapper.setProps({
|
27
|
-
required: false
|
28
|
-
});
|
29
|
-
wrapper.update();
|
30
|
-
assert.strictEqual(wrapper.find(HiFormLabel).find('label').text(), 'Test optional', 'Should render label optional');
|
31
|
-
wrapper.setProps({
|
32
|
-
required: false,
|
33
|
-
translations: {
|
34
|
-
optional: 'Optionnel'
|
35
|
-
}
|
36
|
-
});
|
37
|
-
wrapper.update();
|
38
|
-
assert.strictEqual(wrapper.find(HiFormLabel).find('label').text(), 'Test Optionnel', 'Should render label optional');
|
39
|
-
});
|
40
|
-
it('should render a label with children', function () {
|
41
|
-
var wrapper = mount(React.createElement(HiFormLabel, {
|
42
|
-
label: "Test"
|
43
|
-
}, React.createElement("p", null, " my children")));
|
44
|
-
assert.strictEqual(wrapper.find(HiFormLabel).find('label').text(), 'Test my children', 'Should render label with children');
|
45
|
-
wrapper.setProps({
|
46
|
-
required: false
|
47
|
-
});
|
48
|
-
wrapper.update();
|
49
|
-
assert.strictEqual(wrapper.find(HiFormLabel).find('label').text(), 'Test optional my children', 'Should render label optional');
|
50
|
-
wrapper.setProps({
|
51
|
-
required: false,
|
52
|
-
translations: {
|
53
|
-
optional: 'Optionnel'
|
54
|
-
}
|
55
|
-
});
|
56
|
-
wrapper.update();
|
57
|
-
assert.strictEqual(wrapper.find(HiFormLabel).find('label').text(), 'Test Optionnel my children', 'Should render label optional');
|
58
|
-
});
|
59
|
-
it('should pass className to the HiFormLabel', function () {
|
60
|
-
var wrapper = shallow(React.createElement(HiFormLabel, {
|
61
|
-
label: "Test",
|
62
|
-
className: "foo"
|
63
|
-
}));
|
64
|
-
assert.strictEqual(wrapper.dive().hasClass('foo'), true);
|
65
|
-
});
|
66
|
-
});
|
package/HiForm/HiInput.test.js
DELETED
@@ -1,202 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { spy } from 'sinon';
|
4
|
-
import classNames from 'classnames';
|
5
|
-
import { createShallow, createMount, getClasses } from '../test-utils';
|
6
|
-
import HiInput from './HiInput';
|
7
|
-
describe('<HiInput />', function () {
|
8
|
-
var shallow;
|
9
|
-
var mount;
|
10
|
-
var classes;
|
11
|
-
before(function () {
|
12
|
-
shallow = createShallow({
|
13
|
-
untilSelector: 'HiInput'
|
14
|
-
});
|
15
|
-
classes = getClasses(React.createElement(HiInput, {
|
16
|
-
value: '',
|
17
|
-
onChange: function onChange() {
|
18
|
-
return null;
|
19
|
-
},
|
20
|
-
onReset: function onReset() {
|
21
|
-
return null;
|
22
|
-
},
|
23
|
-
placeholder: 'Rechercher'
|
24
|
-
}));
|
25
|
-
});
|
26
|
-
beforeEach(function () {
|
27
|
-
mount = createMount();
|
28
|
-
});
|
29
|
-
afterEach(function () {
|
30
|
-
mount.cleanUp();
|
31
|
-
});
|
32
|
-
it('should render a td with an Lock icon for code 0', function () {
|
33
|
-
var handleBlur = spy();
|
34
|
-
var wrapper = shallow(React.createElement(HiInput, {
|
35
|
-
value: '',
|
36
|
-
onChange: function onChange() {
|
37
|
-
return null;
|
38
|
-
},
|
39
|
-
onReset: function onReset() {
|
40
|
-
return null;
|
41
|
-
},
|
42
|
-
placeholder: 'Rechercher',
|
43
|
-
autoFocus: false,
|
44
|
-
onBlur: handleBlur
|
45
|
-
}));
|
46
|
-
assert.strictEqual(wrapper.name(), 'div');
|
47
|
-
assert.strictEqual(wrapper.state().focused, false, 'Initial focus is false');
|
48
|
-
});
|
49
|
-
it('should have a fonctionnal input', function () {
|
50
|
-
var handleChange = spy();
|
51
|
-
var handleReset = spy();
|
52
|
-
var handleMouseEnter = spy();
|
53
|
-
var handleMouseLeave = spy();
|
54
|
-
var handleBlur = spy();
|
55
|
-
var handleFocus = spy();
|
56
|
-
var handleSubmit = spy();
|
57
|
-
var handleClick = spy();
|
58
|
-
var wrapper = mount(React.createElement(HiInput, {
|
59
|
-
value: 'test',
|
60
|
-
onClick: handleClick,
|
61
|
-
onChange: handleChange,
|
62
|
-
onReset: handleReset,
|
63
|
-
inputId: 'test-input',
|
64
|
-
onMouseEnter: handleMouseEnter,
|
65
|
-
onMouseLeave: handleMouseLeave,
|
66
|
-
onBlur: handleBlur,
|
67
|
-
onFocus: handleFocus,
|
68
|
-
onSubmit: handleSubmit
|
69
|
-
}));
|
70
|
-
assert.strictEqual(wrapper.find('input').length, 1);
|
71
|
-
assert.strictEqual(wrapper.find('input').props().type, 'text');
|
72
|
-
assert.strictEqual(wrapper.find('input').props().value, 'test');
|
73
|
-
assert.strictEqual(wrapper.find('input').props().placeholder, '');
|
74
|
-
wrapper.setProps({
|
75
|
-
placeholder: 'Rechercher'
|
76
|
-
});
|
77
|
-
wrapper.update();
|
78
|
-
assert.strictEqual(wrapper.find('input').props().placeholder, 'Rechercher');
|
79
|
-
wrapper.find('input').simulate('change', {
|
80
|
-
target: {
|
81
|
-
value: 'newValue'
|
82
|
-
}
|
83
|
-
});
|
84
|
-
assert.strictEqual(handleChange.callCount, 1);
|
85
|
-
assert.strictEqual(handleChange.args[0][0].target.value, 'newValue');
|
86
|
-
assert.strictEqual(wrapper.find('button').length, 0, 'should not have clear icon');
|
87
|
-
wrapper.find('input').simulate('focus');
|
88
|
-
assert.strictEqual(handleFocus.callCount, 1, 'should trigger focus callback');
|
89
|
-
assert.strictEqual(handleSubmit.callCount, 0, 'should not trigger handleSubmit');
|
90
|
-
assert.strictEqual(wrapper.find('button').length, 1, 'should have clear icon');
|
91
|
-
wrapper.find('button').simulate('click');
|
92
|
-
assert.strictEqual(handleReset.callCount, 1, 'should trigger reset callback');
|
93
|
-
assert.strictEqual(handleFocus.callCount, 2, 'should trigger focus callback');
|
94
|
-
assert.strictEqual(handleSubmit.callCount, 0, 'should not trigger handleSubmit');
|
95
|
-
assert.strictEqual(handleClick.callCount, 1, 'should call handleClick once');
|
96
|
-
wrapper.find('input').simulate('click');
|
97
|
-
var input = document.getElementById('test-input');
|
98
|
-
var divs = document.getElementsByClassName(classes.root);
|
99
|
-
|
100
|
-
if (!input) {
|
101
|
-
throw new Error('missing input');
|
102
|
-
}
|
103
|
-
|
104
|
-
assert.strictEqual(handleClick.callCount, 2, 'should call handleClick once more');
|
105
|
-
assert.strictEqual(divs.length, 1);
|
106
|
-
var rootDiv = divs[0];
|
107
|
-
var rootClass = classNames(classes.root, classes.inkbar);
|
108
|
-
var rootFocusClass = classNames(classes.root, classes.inkbar, classes.focused);
|
109
|
-
input.focus();
|
110
|
-
assert.strictEqual(rootDiv.className, rootFocusClass);
|
111
|
-
var focusedElement = document.activeElement;
|
112
|
-
assert.strictEqual(input, focusedElement, 'should trigger reset callback');
|
113
|
-
input.blur();
|
114
|
-
assert.strictEqual(rootDiv.className, rootClass);
|
115
|
-
wrapper.simulate('mouseEnter');
|
116
|
-
assert.strictEqual(handleMouseEnter.callCount, 1, 'should trigger mouse enter callback');
|
117
|
-
wrapper.simulate('mouseLeave');
|
118
|
-
assert.strictEqual(handleMouseLeave.callCount, 1, 'should trigger mouse leave callback'); // Press "enter" on HiSelectInput => onSubmit
|
119
|
-
|
120
|
-
wrapper.find('input').simulate('keydown', {
|
121
|
-
keyCode: 13
|
122
|
-
});
|
123
|
-
assert.strictEqual(handleSubmit.callCount, 1, 'should call handleSubmit once');
|
124
|
-
});
|
125
|
-
it('should not call callbacks', function () {
|
126
|
-
var handleChange = spy();
|
127
|
-
var handleReset = spy();
|
128
|
-
var handleMouseEnter = spy();
|
129
|
-
var handleMouseLeave = spy();
|
130
|
-
var handleBlur = spy();
|
131
|
-
var handleFocus = spy();
|
132
|
-
var wrapper = mount(React.createElement(HiInput, {
|
133
|
-
value: 'test',
|
134
|
-
inputId: 'test-input',
|
135
|
-
onReset: function onReset() {}
|
136
|
-
}));
|
137
|
-
assert.strictEqual(wrapper.find('button').length, 0, 'should not have clear icon');
|
138
|
-
wrapper.find('input').simulate('focus');
|
139
|
-
assert.strictEqual(wrapper.find('button').length, 1, 'should have clear icon');
|
140
|
-
wrapper.find('button').simulate('click');
|
141
|
-
assert.strictEqual(handleReset.callCount, 0, 'should not trigger reset callback');
|
142
|
-
assert.strictEqual(handleFocus.callCount, 0, 'should not trigger focus callback');
|
143
|
-
wrapper.find('input').simulate('change', {
|
144
|
-
target: {
|
145
|
-
value: 'newValue'
|
146
|
-
}
|
147
|
-
});
|
148
|
-
assert.strictEqual(handleChange.callCount, 0);
|
149
|
-
wrapper.find('input').simulate('click');
|
150
|
-
assert.strictEqual(handleBlur.callCount, 0, 'should not trigger blur callback');
|
151
|
-
wrapper.simulate('mouseEnter');
|
152
|
-
assert.strictEqual(handleMouseEnter.callCount, 0, 'should not trigger mouse enter callback');
|
153
|
-
wrapper.simulate('mouseLeave');
|
154
|
-
assert.strictEqual(handleMouseLeave.callCount, 0, 'should not trigger mouse leave callback');
|
155
|
-
});
|
156
|
-
describe('shallow', function () {
|
157
|
-
var wrapper;
|
158
|
-
beforeEach(function () {
|
159
|
-
wrapper = shallow(React.createElement(HiInput, {
|
160
|
-
value: 'test'
|
161
|
-
}));
|
162
|
-
});
|
163
|
-
describe('without icons', function () {
|
164
|
-
it('should have 1 child', function () {
|
165
|
-
assert.strictEqual(wrapper.children().length, 1);
|
166
|
-
});
|
167
|
-
});
|
168
|
-
describe('with clearIcon', function () {
|
169
|
-
beforeEach(function () {
|
170
|
-
wrapper.setProps({
|
171
|
-
onReset: function onReset() {}
|
172
|
-
});
|
173
|
-
});
|
174
|
-
it('should still have 1 child', function () {
|
175
|
-
assert.strictEqual(wrapper.children().length, 1);
|
176
|
-
});
|
177
|
-
});
|
178
|
-
describe('with rightIcon', function () {
|
179
|
-
beforeEach(function () {
|
180
|
-
wrapper.setProps({
|
181
|
-
startAdornment: 'Archive'
|
182
|
-
});
|
183
|
-
});
|
184
|
-
it('should have 1 child', function () {
|
185
|
-
assert.strictEqual(wrapper.children().length, 1);
|
186
|
-
});
|
187
|
-
});
|
188
|
-
describe('with multiline', function () {
|
189
|
-
beforeEach(function () {
|
190
|
-
wrapper.setProps({
|
191
|
-
onReset: function onReset() {},
|
192
|
-
leftIcon: 'Archive',
|
193
|
-
rightIcon: 'Eye',
|
194
|
-
multiline: true
|
195
|
-
});
|
196
|
-
});
|
197
|
-
it('should have 1 child', function () {
|
198
|
-
assert.strictEqual(wrapper.children().length, 1);
|
199
|
-
});
|
200
|
-
});
|
201
|
-
});
|
202
|
-
});
|