@hipay/hipay-material-ui 2.3.1-rc4 → 2.3.1-rc5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
package/HiForm/HiUpload.test.js
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { assert } from 'chai';
|
|
3
|
-
import { spy } from 'sinon';
|
|
4
|
-
import { createMount, createShallow, getClasses } from '../test-utils';
|
|
5
|
-
import classNames from 'classnames';
|
|
6
|
-
import HiUpload from './HiUpload';
|
|
7
|
-
import HiUploadInput from './HiUploadInput';
|
|
8
|
-
import HiIcon from '../HiIcon';
|
|
9
|
-
describe('<HiUpload />', function () {
|
|
10
|
-
var mount;
|
|
11
|
-
var shallow;
|
|
12
|
-
var classes;
|
|
13
|
-
before(function () {
|
|
14
|
-
mount = createMount();
|
|
15
|
-
shallow = createShallow({
|
|
16
|
-
dive: true
|
|
17
|
-
});
|
|
18
|
-
classes = getClasses(React.createElement(HiUpload, {
|
|
19
|
-
inputs: [],
|
|
20
|
-
values: [],
|
|
21
|
-
id: "upload"
|
|
22
|
-
}));
|
|
23
|
-
});
|
|
24
|
-
after(function () {
|
|
25
|
-
mount.cleanUp();
|
|
26
|
-
}); // 1 input empty
|
|
27
|
-
|
|
28
|
-
it('should render 0 <HiUploadInput> because 1 input waiting and undefined value', function () {
|
|
29
|
-
var inputs = [{
|
|
30
|
-
id: 1
|
|
31
|
-
}];
|
|
32
|
-
var values = [undefined];
|
|
33
|
-
var wrapper = shallow(React.createElement(HiUpload, {
|
|
34
|
-
inputs: inputs,
|
|
35
|
-
values: values,
|
|
36
|
-
id: "upload"
|
|
37
|
-
}), {
|
|
38
|
-
disableLifecycleMethods: true
|
|
39
|
-
});
|
|
40
|
-
assert.strictEqual(wrapper.find(HiUploadInput).length, 0, 'should render 0 HiUploadInput');
|
|
41
|
-
assert.strictEqual(wrapper.find(HiIcon).dive().props().className, classNames(classes.statusIcon, classes.empty, classes.fileButton, classes.focusable));
|
|
42
|
-
}); // 1 input empty
|
|
43
|
-
|
|
44
|
-
it('should render 0 <HiUploadInput> because 1 input waiting and no value', function () {
|
|
45
|
-
var inputs = [{
|
|
46
|
-
id: 1
|
|
47
|
-
}];
|
|
48
|
-
var values = [];
|
|
49
|
-
var wrapper = shallow(React.createElement(HiUpload, {
|
|
50
|
-
inputs: inputs,
|
|
51
|
-
values: values,
|
|
52
|
-
id: "upload"
|
|
53
|
-
}), {
|
|
54
|
-
disableLifecycleMethods: true
|
|
55
|
-
});
|
|
56
|
-
assert.strictEqual(wrapper.find(HiUploadInput).length, 0, 'should render 0 HiUploadInput');
|
|
57
|
-
assert.strictEqual(wrapper.find(HiIcon).dive().props().className, classNames(classes.statusIcon, classes.empty, classes.fileButton, classes.focusable));
|
|
58
|
-
}); // 1 input complete
|
|
59
|
-
|
|
60
|
-
it('should render 1 <HiUploadInput> because first value is defined and 1 values is expected', function () {
|
|
61
|
-
var inputs = [{
|
|
62
|
-
id: 1
|
|
63
|
-
}];
|
|
64
|
-
var values = [{
|
|
65
|
-
value: 'test'
|
|
66
|
-
}];
|
|
67
|
-
var wrapper = shallow(React.createElement(HiUpload, {
|
|
68
|
-
inputs: inputs,
|
|
69
|
-
values: values,
|
|
70
|
-
id: "upload"
|
|
71
|
-
}), {
|
|
72
|
-
disableLifecycleMethods: true
|
|
73
|
-
});
|
|
74
|
-
assert.strictEqual(wrapper.find(HiUploadInput).length, 1, 'should render 1 HiUploadInput');
|
|
75
|
-
assert.strictEqual(wrapper.find(HiIcon).dive().props().className, classNames(classes.statusIcon, classes.complete, classes.fileButton, classes.focusable));
|
|
76
|
-
}); // 2 input empty
|
|
77
|
-
|
|
78
|
-
it('should render 2 <HiUploadInput> because first value is defined and 2 values are expected', function () {
|
|
79
|
-
var inputs = [{
|
|
80
|
-
id: 1
|
|
81
|
-
}, {
|
|
82
|
-
id: 2
|
|
83
|
-
}];
|
|
84
|
-
var values = [];
|
|
85
|
-
var wrapper = shallow(React.createElement(HiUpload, {
|
|
86
|
-
inputs: inputs,
|
|
87
|
-
values: values,
|
|
88
|
-
id: "upload"
|
|
89
|
-
}), {
|
|
90
|
-
disableLifecycleMethods: true
|
|
91
|
-
});
|
|
92
|
-
assert.strictEqual(wrapper.find(HiUploadInput).length, 2, 'should render 2 HiUploadInput');
|
|
93
|
-
assert.strictEqual(wrapper.find(HiIcon).dive().props().className, classNames(classes.statusIcon, classes.empty, classes.fileButton, classes.focusable));
|
|
94
|
-
}); // 2 input not empty / not full
|
|
95
|
-
|
|
96
|
-
it('should render 2 <HiUploadInput> because first value is defined and 2 values are expected', function () {
|
|
97
|
-
var inputs = [{
|
|
98
|
-
id: 1
|
|
99
|
-
}, {
|
|
100
|
-
id: 2
|
|
101
|
-
}];
|
|
102
|
-
var values = [{
|
|
103
|
-
value: 'test'
|
|
104
|
-
}, undefined];
|
|
105
|
-
var wrapper = shallow(React.createElement(HiUpload, {
|
|
106
|
-
inputs: inputs,
|
|
107
|
-
values: values,
|
|
108
|
-
id: "upload"
|
|
109
|
-
}), {
|
|
110
|
-
disableLifecycleMethods: true
|
|
111
|
-
});
|
|
112
|
-
assert.strictEqual(wrapper.find(HiUploadInput).length, 2, 'should render 2 HiUploadInput');
|
|
113
|
-
assert.strictEqual(wrapper.find(HiIcon).dive().props().className, classNames(classes.statusIcon, classes.fileButton, classes.focusable));
|
|
114
|
-
}); // 2 input full => not focusable
|
|
115
|
-
|
|
116
|
-
it('should render 2 <HiUploadInput> because first value is defined and 2 values are expected', function () {
|
|
117
|
-
var inputs = [{
|
|
118
|
-
id: 1
|
|
119
|
-
}, {
|
|
120
|
-
id: 2
|
|
121
|
-
}];
|
|
122
|
-
var values = [{
|
|
123
|
-
value: 'test'
|
|
124
|
-
}, {
|
|
125
|
-
value: 'test2'
|
|
126
|
-
}];
|
|
127
|
-
var wrapper = shallow(React.createElement(HiUpload, {
|
|
128
|
-
inputs: inputs,
|
|
129
|
-
values: values,
|
|
130
|
-
id: "upload"
|
|
131
|
-
}), {
|
|
132
|
-
disableLifecycleMethods: true
|
|
133
|
-
});
|
|
134
|
-
assert.strictEqual(wrapper.find(HiUploadInput).length, 2, 'should render 2 HiUploadInput');
|
|
135
|
-
assert.strictEqual(wrapper.find(HiIcon).dive().props().className, classNames(classes.statusIcon, classes.complete, classes.fileButton));
|
|
136
|
-
}); // unlimited inputs empty
|
|
137
|
-
|
|
138
|
-
it('should render 0 <HiUploadInput> because unlimited inputs and no values', function () {
|
|
139
|
-
var inputs = [];
|
|
140
|
-
var values = [];
|
|
141
|
-
var wrapper = shallow(React.createElement(HiUpload, {
|
|
142
|
-
inputs: inputs,
|
|
143
|
-
values: values,
|
|
144
|
-
id: "upload"
|
|
145
|
-
}), {
|
|
146
|
-
disableLifecycleMethods: true
|
|
147
|
-
});
|
|
148
|
-
assert.strictEqual(wrapper.find(HiUploadInput).length, 0, 'should render 1 HiUploadInput');
|
|
149
|
-
assert.strictEqual(wrapper.find(HiIcon).dive().props().className, classNames(classes.statusIcon, classes.empty, classes.fileButton, classes.focusable));
|
|
150
|
-
});
|
|
151
|
-
it('should render 5 <HiUploadInput> because unlimited inputs and 5 values', function () {
|
|
152
|
-
var inputs = [];
|
|
153
|
-
var values = [{
|
|
154
|
-
value: 'test1'
|
|
155
|
-
}, {
|
|
156
|
-
value: 'test2'
|
|
157
|
-
}, {
|
|
158
|
-
value: 'test3'
|
|
159
|
-
}, {
|
|
160
|
-
value: 'test4'
|
|
161
|
-
}, {
|
|
162
|
-
value: 'test5'
|
|
163
|
-
}];
|
|
164
|
-
var wrapper = shallow(React.createElement(HiUpload, {
|
|
165
|
-
inputs: inputs,
|
|
166
|
-
values: values,
|
|
167
|
-
id: "upload"
|
|
168
|
-
}), {
|
|
169
|
-
disableLifecycleMethods: true
|
|
170
|
-
});
|
|
171
|
-
assert.strictEqual(wrapper.find(HiUploadInput).length, 5, 'should render 1 HiUploadInput');
|
|
172
|
-
assert.strictEqual(wrapper.find(HiIcon).dive().props().className, classNames(classes.statusIcon, classes.empty, classes.fileButton, classes.focusable));
|
|
173
|
-
});
|
|
174
|
-
it('should fire onChange event callbacks', function () {
|
|
175
|
-
var inputs = [{
|
|
176
|
-
id: 1
|
|
177
|
-
}, {
|
|
178
|
-
id: 2
|
|
179
|
-
}];
|
|
180
|
-
var values = [{
|
|
181
|
-
value: {
|
|
182
|
-
name: 'test.pdf',
|
|
183
|
-
size: 32,
|
|
184
|
-
type: 'application/pdf'
|
|
185
|
-
}
|
|
186
|
-
}, undefined];
|
|
187
|
-
var handleChange = spy();
|
|
188
|
-
var wrapper = shallow(React.createElement(HiUpload, {
|
|
189
|
-
onChange: handleChange,
|
|
190
|
-
inputs: inputs,
|
|
191
|
-
values: values,
|
|
192
|
-
id: "upload"
|
|
193
|
-
}), {
|
|
194
|
-
disableLifecycleMethods: true
|
|
195
|
-
});
|
|
196
|
-
var fakeFile = {
|
|
197
|
-
name: 'fakefile.pdf',
|
|
198
|
-
size: 32,
|
|
199
|
-
type: 'application/pdf'
|
|
200
|
-
};
|
|
201
|
-
var fakeChangeParams = {
|
|
202
|
-
errorMessage: '',
|
|
203
|
-
error: false,
|
|
204
|
-
value: fakeFile
|
|
205
|
-
};
|
|
206
|
-
assert.strictEqual(wrapper.find(HiIcon).prop('icon'), 'file_upload', 'should render a upload icon');
|
|
207
|
-
wrapper.find(HiUploadInput).at(0).dive().simulate('change', fakeChangeParams, 0);
|
|
208
|
-
assert.strictEqual(handleChange.calledWith({
|
|
209
|
-
errorMessage: '',
|
|
210
|
-
error: false,
|
|
211
|
-
value: fakeFile
|
|
212
|
-
}, 0), true, 'should have been called with the fakeFile.');
|
|
213
|
-
});
|
|
214
|
-
it('should be on error', function () {
|
|
215
|
-
var inputs = [{
|
|
216
|
-
id: 1
|
|
217
|
-
}, {
|
|
218
|
-
id: 2
|
|
219
|
-
}];
|
|
220
|
-
var fakeFile = {
|
|
221
|
-
name: 'fakefile.pdf',
|
|
222
|
-
size: 32,
|
|
223
|
-
type: 'application/pdf'
|
|
224
|
-
};
|
|
225
|
-
var fakeFalseParams = {
|
|
226
|
-
errorMessage: 'error message',
|
|
227
|
-
error: true,
|
|
228
|
-
value: fakeFile
|
|
229
|
-
};
|
|
230
|
-
var values = [fakeFalseParams, undefined];
|
|
231
|
-
var wrapper = shallow(React.createElement(HiUpload, {
|
|
232
|
-
inputs: inputs,
|
|
233
|
-
values: values,
|
|
234
|
-
id: "upload"
|
|
235
|
-
}), {
|
|
236
|
-
disableLifecycleMethods: true
|
|
237
|
-
});
|
|
238
|
-
assert.include(wrapper.find(HiIcon).props().className, 'error', 'should have the class error');
|
|
239
|
-
assert.strictEqual(wrapper.find(HiIcon).dive().props().className, classNames(classes.statusIcon, classes.empty, classes.fileButton, classes.error, classes.focusable));
|
|
240
|
-
});
|
|
241
|
-
});
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { assert } from 'chai';
|
|
3
|
-
import { createMount, createShallow } from '../test-utils';
|
|
4
|
-
import HiUpload from './HiUpload';
|
|
5
|
-
import HiUploadField from './HiUploadField';
|
|
6
|
-
import HiFormControl from './HiFormControl';
|
|
7
|
-
describe('<HiUploadField />', function () {
|
|
8
|
-
var mount;
|
|
9
|
-
var shallow;
|
|
10
|
-
before(function () {
|
|
11
|
-
mount = createMount();
|
|
12
|
-
shallow = createShallow();
|
|
13
|
-
});
|
|
14
|
-
after(function () {
|
|
15
|
-
mount.cleanUp();
|
|
16
|
-
});
|
|
17
|
-
it('should render a <HiFormControl>and a <HiUpload>', function () {
|
|
18
|
-
var inputs = [{
|
|
19
|
-
id: 1
|
|
20
|
-
}, {
|
|
21
|
-
id: 2
|
|
22
|
-
}];
|
|
23
|
-
var values = [undefined, undefined];
|
|
24
|
-
var wrapper = shallow(React.createElement(HiUploadField, {
|
|
25
|
-
inputs: inputs,
|
|
26
|
-
values: values
|
|
27
|
-
}));
|
|
28
|
-
assert.strictEqual(wrapper.find(HiFormControl).length, 1, 'should render a HiFormControl');
|
|
29
|
-
assert.strictEqual(wrapper.find(HiUpload).length, 1, 'should render a HiUpload');
|
|
30
|
-
});
|
|
31
|
-
it('should be on error', function () {
|
|
32
|
-
var inputs = [{
|
|
33
|
-
id: 1
|
|
34
|
-
}, {
|
|
35
|
-
id: 2
|
|
36
|
-
}];
|
|
37
|
-
var fakeFile = {
|
|
38
|
-
name: 'fakefile.pdf',
|
|
39
|
-
size: 32,
|
|
40
|
-
type: 'application/pdf'
|
|
41
|
-
};
|
|
42
|
-
var fakeFalseParams = {
|
|
43
|
-
errorMessage: 'error message',
|
|
44
|
-
error: true,
|
|
45
|
-
value: fakeFile
|
|
46
|
-
};
|
|
47
|
-
var values = [fakeFalseParams, undefined];
|
|
48
|
-
var wrapper = shallow(React.createElement(HiUploadField, {
|
|
49
|
-
inputs: inputs,
|
|
50
|
-
values: values
|
|
51
|
-
}));
|
|
52
|
-
assert.strictEqual(wrapper.find(HiFormControl).props().errorText, 'error message', 'should have the error message given by the change');
|
|
53
|
-
assert.strictEqual(wrapper.find(HiFormControl).props().error, true, 'should be on error');
|
|
54
|
-
});
|
|
55
|
-
});
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { assert } from 'chai';
|
|
3
|
-
import { spy } from 'sinon';
|
|
4
|
-
import { createMount } from '../test-utils';
|
|
5
|
-
import HiUploadInput from './HiUploadInput';
|
|
6
|
-
import HiIconButton from '../HiIconButton';
|
|
7
|
-
describe('<HiUploadInput />', function () {
|
|
8
|
-
var mount;
|
|
9
|
-
var fakePdf;
|
|
10
|
-
var seeFile;
|
|
11
|
-
before(function () {
|
|
12
|
-
fakePdf = {
|
|
13
|
-
name: 'fakefile.pdf',
|
|
14
|
-
size: 32,
|
|
15
|
-
type: 'application/pdf'
|
|
16
|
-
};
|
|
17
|
-
seeFile = true;
|
|
18
|
-
});
|
|
19
|
-
beforeEach(function () {
|
|
20
|
-
mount = createMount();
|
|
21
|
-
});
|
|
22
|
-
afterEach(function () {
|
|
23
|
-
mount.cleanUp();
|
|
24
|
-
});
|
|
25
|
-
it('should render an <input> with type file inside a <label> inside a <div>', function () {
|
|
26
|
-
var defaultPlaceholder = 'default placeholder';
|
|
27
|
-
var wrapper = mount(React.createElement(HiUploadInput, {
|
|
28
|
-
placeholder: defaultPlaceholder
|
|
29
|
-
}));
|
|
30
|
-
var label = wrapper.find('label');
|
|
31
|
-
assert.strictEqual(label.name(), 'label', 'should render a label');
|
|
32
|
-
assert.strictEqual(label.text(), defaultPlaceholder, 'should be the placeholder passed in props');
|
|
33
|
-
var input = label.find('input');
|
|
34
|
-
assert.strictEqual(input.name(), 'input', 'should contain an input');
|
|
35
|
-
assert.strictEqual(input.prop('type'), 'file', 'should be a file input');
|
|
36
|
-
});
|
|
37
|
-
it('should not show the clear and see buttons when no value is given', function () {
|
|
38
|
-
var wrapper = mount(React.createElement(HiUploadInput, null));
|
|
39
|
-
assert.strictEqual(wrapper.find(HiIconButton).length, 0, 'should not have icons');
|
|
40
|
-
});
|
|
41
|
-
it('should show the clear and see buttons when a value is given', function () {
|
|
42
|
-
var wrapper = mount(React.createElement(HiUploadInput, {
|
|
43
|
-
value: fakePdf,
|
|
44
|
-
seeFile: seeFile
|
|
45
|
-
}));
|
|
46
|
-
assert.strictEqual(wrapper.find(HiIconButton).length, 2, 'should have the clear and see icons');
|
|
47
|
-
});
|
|
48
|
-
it('should show the clear button when a value is given', function () {
|
|
49
|
-
var wrapper = mount(React.createElement(HiUploadInput, {
|
|
50
|
-
value: fakePdf
|
|
51
|
-
}));
|
|
52
|
-
assert.strictEqual(wrapper.find(HiIconButton).length, 1, 'should have the clear icon');
|
|
53
|
-
});
|
|
54
|
-
it('should fire onChange event callbacks', function () {
|
|
55
|
-
var handleChange = spy();
|
|
56
|
-
var wrapper = mount(React.createElement(HiUploadInput, {
|
|
57
|
-
onChange: handleChange,
|
|
58
|
-
index: 1
|
|
59
|
-
}));
|
|
60
|
-
wrapper.find('input').simulate('change', {
|
|
61
|
-
target: {
|
|
62
|
-
files: [fakePdf]
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
assert.strictEqual(handleChange.calledOnce, true, 'should have been called once.');
|
|
66
|
-
assert.strictEqual(handleChange.calledWith({
|
|
67
|
-
errorMessage: '',
|
|
68
|
-
error: false,
|
|
69
|
-
value: fakePdf
|
|
70
|
-
}, 1), true, 'should have been called with the fakePdf file.');
|
|
71
|
-
});
|
|
72
|
-
it('should fire onDeleteFile event callbacks', function () {
|
|
73
|
-
var handleDeleteFile = spy();
|
|
74
|
-
var wrapper = mount(React.createElement(HiUploadInput, {
|
|
75
|
-
onDeleteFile: handleDeleteFile,
|
|
76
|
-
value: fakePdf,
|
|
77
|
-
index: 1
|
|
78
|
-
}));
|
|
79
|
-
wrapper.find(HiIconButton).at(0).simulate('click');
|
|
80
|
-
assert.strictEqual(handleDeleteFile.calledOnce, true, 'should have been called once.');
|
|
81
|
-
assert.strictEqual(handleDeleteFile.calledWith(1), true, 'should have been called with the index of this HiUploadInput.');
|
|
82
|
-
});
|
|
83
|
-
it('should fire onSee event callbacks', function () {
|
|
84
|
-
var handleSee = spy();
|
|
85
|
-
var wrapper = mount(React.createElement(HiUploadInput, {
|
|
86
|
-
onSeeFile: handleSee,
|
|
87
|
-
value: fakePdf,
|
|
88
|
-
index: 1,
|
|
89
|
-
seeFile: seeFile
|
|
90
|
-
}));
|
|
91
|
-
wrapper.find(HiIconButton).at(0).simulate('click');
|
|
92
|
-
assert.strictEqual(handleSee.calledOnce, true, 'should have been called once.');
|
|
93
|
-
assert.strictEqual(handleSee.calledWith(fakePdf), true, 'should have been called with the file to see.');
|
|
94
|
-
});
|
|
95
|
-
it('should fire onChange event callbacks with a size error', function () {
|
|
96
|
-
var handleChange = spy();
|
|
97
|
-
var translations = {
|
|
98
|
-
errorSize: 'error size'
|
|
99
|
-
};
|
|
100
|
-
var fakeLargeFile = {
|
|
101
|
-
name: 'fakelargefile.pdf',
|
|
102
|
-
size: 4096,
|
|
103
|
-
type: 'application/pdf'
|
|
104
|
-
};
|
|
105
|
-
var wrapper = mount(React.createElement(HiUploadInput, {
|
|
106
|
-
onChange: handleChange,
|
|
107
|
-
value: fakeLargeFile,
|
|
108
|
-
maxSize: 2048,
|
|
109
|
-
index: 1,
|
|
110
|
-
translations: translations
|
|
111
|
-
}));
|
|
112
|
-
wrapper.find('input').simulate('change', {
|
|
113
|
-
target: {
|
|
114
|
-
files: [fakeLargeFile]
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
assert.strictEqual(handleChange.calledOnce, true, 'should have been called once.');
|
|
118
|
-
assert.strictEqual(handleChange.calledWith({
|
|
119
|
-
errorMessage: translations.errorSize,
|
|
120
|
-
error: true,
|
|
121
|
-
value: fakeLargeFile
|
|
122
|
-
}, 1), true, 'should be on error with errorSize message');
|
|
123
|
-
});
|
|
124
|
-
it('should fire onChange event callbacks with a type error', function () {
|
|
125
|
-
var handleChange = spy();
|
|
126
|
-
var translations = {
|
|
127
|
-
errorType: 'error type'
|
|
128
|
-
};
|
|
129
|
-
var wrapper = mount(React.createElement(HiUploadInput, {
|
|
130
|
-
onChange: handleChange,
|
|
131
|
-
value: fakePdf,
|
|
132
|
-
acceptedTypes: ['image/jpeg', 'video/mp4'],
|
|
133
|
-
index: 1,
|
|
134
|
-
translations: translations
|
|
135
|
-
}));
|
|
136
|
-
wrapper.find('input').simulate('change', {
|
|
137
|
-
target: {
|
|
138
|
-
files: [fakePdf]
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
assert.strictEqual(handleChange.calledOnce, true, 'should have been called once.');
|
|
142
|
-
assert.strictEqual(handleChange.calledWith({
|
|
143
|
-
errorMessage: translations.errorType,
|
|
144
|
-
error: true,
|
|
145
|
-
value: fakePdf
|
|
146
|
-
}, 1), true, 'should be on error with errorType message');
|
|
147
|
-
});
|
|
148
|
-
});
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { assert } from 'chai';
|
|
3
|
-
import { createShallow, createRender, getClasses } from '../test-utils';
|
|
4
|
-
import HiIconButton from './HiIconButton';
|
|
5
|
-
import IconButton from '@material-ui/core/IconButton';
|
|
6
|
-
import classNames from 'classnames';
|
|
7
|
-
describe('<HiIconButton />', function () {
|
|
8
|
-
var shallow;
|
|
9
|
-
var render;
|
|
10
|
-
var classes;
|
|
11
|
-
var buttonClasses = getClasses(React.createElement(IconButton, null, "Hello World"));
|
|
12
|
-
before(function () {
|
|
13
|
-
shallow = createShallow({
|
|
14
|
-
dive: true
|
|
15
|
-
});
|
|
16
|
-
render = createRender();
|
|
17
|
-
classes = getClasses(React.createElement(HiIconButton, null, "Hello World"));
|
|
18
|
-
});
|
|
19
|
-
it('should render a <IconButton> element', function () {
|
|
20
|
-
var wrapper = shallow(React.createElement(HiIconButton, null, "Hello World"));
|
|
21
|
-
assert.strictEqual(wrapper.find(IconButton).length, 1);
|
|
22
|
-
});
|
|
23
|
-
it('should render forward primary color prop to <IconButton> component', function () {
|
|
24
|
-
var wrapper = shallow(React.createElement(HiIconButton, {
|
|
25
|
-
color: "primary"
|
|
26
|
-
}, "Hello World"));
|
|
27
|
-
assert.strictEqual(wrapper.find(IconButton).dive().props().color, 'primary', 'should render with the button color inherit');
|
|
28
|
-
assert.strictEqual(wrapper.find(IconButton).dive().props().classes.root, classNames(buttonClasses.root));
|
|
29
|
-
});
|
|
30
|
-
it('should render with the positive classes and set color to inherit', function () {
|
|
31
|
-
var wrapper = shallow(React.createElement(HiIconButton, {
|
|
32
|
-
color: "positive"
|
|
33
|
-
}, "Hello World"));
|
|
34
|
-
assert.strictEqual(wrapper.find(IconButton).dive().props().color, 'inherit', 'should render with the button color inherit');
|
|
35
|
-
assert.strictEqual(wrapper.find(IconButton).dive().props().classes.root, classNames(buttonClasses.root, classes.positive));
|
|
36
|
-
});
|
|
37
|
-
it('should render with the negative classes and set color to inherit', function () {
|
|
38
|
-
var wrapper = shallow(React.createElement(HiIconButton, {
|
|
39
|
-
color: "negative"
|
|
40
|
-
}, "Hello World"));
|
|
41
|
-
assert.strictEqual(wrapper.find(IconButton).dive().props().color, 'inherit', 'should render with the button color inherit');
|
|
42
|
-
assert.strictEqual(wrapper.find(IconButton).dive().props().classes.root, classNames(buttonClasses.root, classes.negative));
|
|
43
|
-
});
|
|
44
|
-
it('should render with the middle classes and set color to inherit', function () {
|
|
45
|
-
var wrapper = shallow(React.createElement(HiIconButton, {
|
|
46
|
-
color: "middle"
|
|
47
|
-
}, "Hello World"));
|
|
48
|
-
assert.strictEqual(wrapper.find(IconButton).dive().props().color, 'inherit', 'should render with the button color inherit');
|
|
49
|
-
assert.strictEqual(wrapper.find(IconButton).dive().props().classes.root, classNames(buttonClasses.root, classes.middle));
|
|
50
|
-
});
|
|
51
|
-
it('should render with the neutral classes and set color to inherit', function () {
|
|
52
|
-
var wrapper = shallow(React.createElement(HiIconButton, {
|
|
53
|
-
color: "neutral"
|
|
54
|
-
}, "Hello World"));
|
|
55
|
-
assert.strictEqual(wrapper.find(IconButton).dive().props().color, 'inherit', 'should render with the button color inherit');
|
|
56
|
-
assert.strictEqual(wrapper.find(IconButton).dive().props().classes.root, classNames(buttonClasses.root, classes.neutral));
|
|
57
|
-
});
|
|
58
|
-
describe('server side', function () {
|
|
59
|
-
// Only run the test on node.
|
|
60
|
-
if (!/jsdom/.test(window.navigator.userAgent)) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
it('should server side render', function () {
|
|
65
|
-
var markup = render(React.createElement(HiIconButton, null, "Hello World"));
|
|
66
|
-
assert.strictEqual(markup.text(), 'Hello World');
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { assert } from 'chai';
|
|
3
|
-
import { createShallow } from '../test-utils';
|
|
4
|
-
import HiLoader from './HiLoader';
|
|
5
|
-
describe('<HiLoader />', function () {
|
|
6
|
-
var shallow;
|
|
7
|
-
before(function () {
|
|
8
|
-
shallow = createShallow({
|
|
9
|
-
dive: true
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
it('renders a functional hour & minute ListPicker', function () {
|
|
13
|
-
var wrapper = shallow(React.createElement(HiLoader, {
|
|
14
|
-
loading: true
|
|
15
|
-
}));
|
|
16
|
-
assert.strictEqual(wrapper.name(), 'div', 'should render a div');
|
|
17
|
-
});
|
|
18
|
-
});
|
package/HiMap/HiMap.test.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { assert } from 'chai';
|
|
3
|
-
import { createMount } from '../test-utils';
|
|
4
|
-
import HiMap from './HiMap';
|
|
5
|
-
|
|
6
|
-
require('isomorphic-fetch'); // pour la méthode fetch()
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
describe('<HiMap />', function () {
|
|
10
|
-
var mount;
|
|
11
|
-
before(function () {
|
|
12
|
-
global.HTMLImageElement = function () {};
|
|
13
|
-
|
|
14
|
-
global.HTMLVideoElement = function () {};
|
|
15
|
-
|
|
16
|
-
mount = createMount();
|
|
17
|
-
});
|
|
18
|
-
after(function () {
|
|
19
|
-
mount.cleanUp();
|
|
20
|
-
});
|
|
21
|
-
it('renders a HiMap', function () {
|
|
22
|
-
var wrapper = mount(React.createElement(HiMap, {
|
|
23
|
-
address: '21 rue de Cornulier, 44000 Nantes'
|
|
24
|
-
}), {
|
|
25
|
-
lifecycleExperimental: true
|
|
26
|
-
});
|
|
27
|
-
assert.strictEqual(wrapper.find(HiMap).length, 1, 'render HiMap');
|
|
28
|
-
});
|
|
29
|
-
});
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { assert } from 'chai';
|
|
4
|
-
import ExpansionPanel from '@material-ui/core/ExpansionPanel';
|
|
5
|
-
import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary';
|
|
6
|
-
import { createShallow } from '../test-utils';
|
|
7
|
-
import HiMap from './HiMap';
|
|
8
|
-
import HiMapExpand from './HiMapExpand';
|
|
9
|
-
describe('<HiMapExpand />', function _callee() {
|
|
10
|
-
var shallow, flagPath;
|
|
11
|
-
return _regeneratorRuntime.async(function _callee$(_context) {
|
|
12
|
-
while (1) {
|
|
13
|
-
switch (_context.prev = _context.next) {
|
|
14
|
-
case 0:
|
|
15
|
-
flagPath = '/static/images/countries/fr.svg';
|
|
16
|
-
before(function () {
|
|
17
|
-
global.HTMLImageElement = function () {};
|
|
18
|
-
|
|
19
|
-
global.HTMLVideoElement = function () {};
|
|
20
|
-
|
|
21
|
-
shallow = createShallow({
|
|
22
|
-
dive: true
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
it('renders an ExpansionPanel containing a HiMap', function () {
|
|
26
|
-
var wrapper = shallow(React.createElement(HiMapExpand, {
|
|
27
|
-
address: '21 rue de Cornulier 44000 Nantes'
|
|
28
|
-
}));
|
|
29
|
-
assert.strictEqual(wrapper.type(), ExpansionPanel, 'should render an ExpansionPanel');
|
|
30
|
-
assert.strictEqual(wrapper.find(HiMap).length, 1, 'should contain a HiMap');
|
|
31
|
-
});
|
|
32
|
-
it('should show an image of the flag and the address', function () {
|
|
33
|
-
var address = '21 Rue de Cornulier, 44000 Nantes';
|
|
34
|
-
var wrapper = shallow(React.createElement(HiMapExpand, {
|
|
35
|
-
address: address,
|
|
36
|
-
countryFlagPath: flagPath
|
|
37
|
-
}));
|
|
38
|
-
assert.strictEqual(wrapper.find(ExpansionPanelSummary).find('div').at(1).find('p').render().text(), address, 'should show the address passed in props');
|
|
39
|
-
assert.strictEqual(wrapper.find(ExpansionPanelSummary).find('div').at(1).find('img').length, 1, 'should render an img with the flag');
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
case 4:
|
|
43
|
-
case "end":
|
|
44
|
-
return _context.stop();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
});
|