@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,49 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { createShallow, getClasses } from '../test-utils';
|
4
|
-
import CellImage from './CellImage';
|
5
|
-
describe('<CellImage/>', function () {
|
6
|
-
var shallow;
|
7
|
-
var classes;
|
8
|
-
before(function () {
|
9
|
-
shallow = createShallow({
|
10
|
-
dive: true
|
11
|
-
});
|
12
|
-
classes = getClasses(React.createElement(CellImage, {
|
13
|
-
type: 'image',
|
14
|
-
label: 'visa',
|
15
|
-
path: '/static/hmus/images/logo_visa_75wx45h.gif'
|
16
|
-
}));
|
17
|
-
});
|
18
|
-
it('should render a td with an img inside and label if value', function () {
|
19
|
-
var wrapper = shallow(React.createElement(CellImage, {
|
20
|
-
type: 'image',
|
21
|
-
label: 'test value',
|
22
|
-
path: '/static/hmus/images/logo_visa_75wx45h.gif'
|
23
|
-
}));
|
24
|
-
assert.strictEqual(wrapper.find('img').length, 1, 'should have 1 image');
|
25
|
-
assert.strictEqual(wrapper.find('img').hasClass(classes.img), true, 'should have the img class');
|
26
|
-
wrapper.setProps({
|
27
|
-
view: 'l'
|
28
|
-
});
|
29
|
-
wrapper.update();
|
30
|
-
assert.strictEqual(wrapper.find('div').length, 1, 'should have 1 div');
|
31
|
-
assert.strictEqual(wrapper.find('div').text(), 'test value', 'should have correct label');
|
32
|
-
});
|
33
|
-
it('should render a td with an img inside and label if value', function () {
|
34
|
-
var wrapper = shallow(React.createElement(CellImage, {
|
35
|
-
sticky: true,
|
36
|
-
type: 'image',
|
37
|
-
label: 'test value',
|
38
|
-
path: '/static/hmus/images/logo_visa_75wx45h.gif'
|
39
|
-
}));
|
40
|
-
assert.strictEqual(wrapper.find('img').length, 1, 'should have 1 image');
|
41
|
-
assert.strictEqual(wrapper.find('img').hasClass(classes.img), true, 'should have the img class');
|
42
|
-
wrapper.setProps({
|
43
|
-
view: 'l'
|
44
|
-
});
|
45
|
-
wrapper.update();
|
46
|
-
assert.strictEqual(wrapper.find('span').length, 1, 'should have 1 label');
|
47
|
-
assert.strictEqual(wrapper.find('span').text(), 'test value', 'should have correct label');
|
48
|
-
});
|
49
|
-
});
|
@@ -1,46 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { createShallow, getClasses } from '../test-utils';
|
4
|
-
import CellNumeric from './CellNumeric';
|
5
|
-
describe('<CellNumeric />', function () {
|
6
|
-
var shallow;
|
7
|
-
var classes;
|
8
|
-
before(function () {
|
9
|
-
shallow = createShallow({
|
10
|
-
dive: true
|
11
|
-
});
|
12
|
-
classes = getClasses(React.createElement(CellNumeric, {
|
13
|
-
type: 'numeric',
|
14
|
-
value: 2345
|
15
|
-
}));
|
16
|
-
});
|
17
|
-
it('should render a td with 1 span (for value)', function () {
|
18
|
-
var wrapper = shallow(React.createElement(CellNumeric, {
|
19
|
-
type: 'numeric',
|
20
|
-
value: 2345
|
21
|
-
}));
|
22
|
-
assert.strictEqual(wrapper.find('div').length, 1, 'Should have 1 span.');
|
23
|
-
assert.strictEqual(wrapper.find('div').hasClass(classes.wrapper), true);
|
24
|
-
});
|
25
|
-
it('should render a cell with 1 span (for value)', function () {
|
26
|
-
var wrapper = shallow(React.createElement(CellNumeric, {
|
27
|
-
type: 'numeric',
|
28
|
-
value: 2345,
|
29
|
-
view: 'l',
|
30
|
-
currency: 'EUR'
|
31
|
-
}));
|
32
|
-
assert.strictEqual(wrapper.find('div').length, 1, 'Should have 1 span.');
|
33
|
-
assert.strictEqual(wrapper.find('div').hasClass(classes.wrapper), true);
|
34
|
-
});
|
35
|
-
it('should render a cell with 1 span (for value)', function () {
|
36
|
-
var wrapper = shallow(React.createElement(CellNumeric, {
|
37
|
-
type: 'numeric',
|
38
|
-
sticky: true,
|
39
|
-
value: 2345,
|
40
|
-
view: 's',
|
41
|
-
currency: 'EUR'
|
42
|
-
}));
|
43
|
-
assert.strictEqual(wrapper.find('div').length, 1, 'Should have 1 span.');
|
44
|
-
assert.strictEqual(wrapper.find('div').hasClass(classes.wrapper), true);
|
45
|
-
});
|
46
|
-
});
|
@@ -1,73 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { ArrowTopRight, Equal, ArrowBottomRight } from 'mdi-material-ui';
|
4
|
-
import { createShallow, getClasses } from '../test-utils';
|
5
|
-
import CellRate from './CellRate';
|
6
|
-
describe('<CellRate/>', function () {
|
7
|
-
var shallow;
|
8
|
-
var classes;
|
9
|
-
before(function () {
|
10
|
-
shallow = createShallow({
|
11
|
-
dive: true
|
12
|
-
});
|
13
|
-
classes = getClasses(React.createElement(CellRate, {
|
14
|
-
type: 'rate',
|
15
|
-
value: 13.3,
|
16
|
-
trendchip: 'up'
|
17
|
-
}));
|
18
|
-
});
|
19
|
-
it('should render a simple div with class and arrow icon', function () {
|
20
|
-
var wrapper = shallow(React.createElement(CellRate, {
|
21
|
-
type: 'rate',
|
22
|
-
value: 13.3,
|
23
|
-
trendchip: 'up'
|
24
|
-
}));
|
25
|
-
assert.strictEqual(wrapper.find('span').length, 0, 'Should not render span containing indicator');
|
26
|
-
assert.strictEqual(wrapper.childAt(0).hasClass(classes.rateDiv), true, 'Should have the rateDiv class');
|
27
|
-
assert.strictEqual(wrapper.find(ArrowTopRight).length, 1, 'Should render a div containing rate & Arrow oriented to top');
|
28
|
-
});
|
29
|
-
it('should render a simple div with class and arrow icon', function () {
|
30
|
-
var wrapper = shallow(React.createElement(CellRate, {
|
31
|
-
type: 'rate',
|
32
|
-
value: 13.3,
|
33
|
-
trendchip: 'up',
|
34
|
-
isPositive: false
|
35
|
-
}));
|
36
|
-
assert.strictEqual(wrapper.find('span').length, 0, 'Should not render span containing indicator');
|
37
|
-
assert.strictEqual(wrapper.childAt(0).hasClass(classes.rateDiv), true, 'Should have the rateDiv class');
|
38
|
-
assert.strictEqual(wrapper.find(ArrowTopRight).length, 1, 'Should render a div containing rate & Arrow oriented to top');
|
39
|
-
});
|
40
|
-
it('should render a div with equal icon', function () {
|
41
|
-
var wrapper = shallow(React.createElement(CellRate, {
|
42
|
-
type: 'rate',
|
43
|
-
value: 13.3,
|
44
|
-
trendchip: 'equal'
|
45
|
-
}));
|
46
|
-
assert.strictEqual(wrapper.find(Equal).length, 1, 'Should render a div containing rate & Equal icon');
|
47
|
-
});
|
48
|
-
it('should render a div with an indicator span & div inside & arrow bottom icon inside', function () {
|
49
|
-
var wrapper = shallow(React.createElement(CellRate, {
|
50
|
-
type: 'rate',
|
51
|
-
value: 13.3,
|
52
|
-
trendchip: 'down',
|
53
|
-
isPositive: false,
|
54
|
-
indicator: 'volume'
|
55
|
-
}));
|
56
|
-
assert.strictEqual(wrapper.find(ArrowBottomRight).length, 1, 'Should render a div containing rate & ArrowBottomRight icon');
|
57
|
-
assert.strictEqual(wrapper.find('span').length, 1, 'Should render a span containing an indication on the data that the rate is applying');
|
58
|
-
assert.strictEqual(wrapper.childAt(0).hasClass(classes.rateDiv), false, 'Should have the rateDiv class');
|
59
|
-
assert.strictEqual(wrapper.childAt(1).hasClass(classes.spanIndicator), true, 'Should have the spanIndicator class');
|
60
|
-
});
|
61
|
-
it('should render a div with an indicator span & div inside & arrow bottom icon inside', function () {
|
62
|
-
var wrapper = shallow(React.createElement(CellRate, {
|
63
|
-
type: 'rate',
|
64
|
-
value: 13.3,
|
65
|
-
trendchip: 'down',
|
66
|
-
indicator: 'volume'
|
67
|
-
}));
|
68
|
-
assert.strictEqual(wrapper.find(ArrowBottomRight).length, 1, 'Should render a div containing rate & ArrowBottomRight icon');
|
69
|
-
assert.strictEqual(wrapper.find('span').length, 1, 'Should render a span containing an indication on the data that the rate is applying');
|
70
|
-
assert.strictEqual(wrapper.childAt(0).hasClass(classes.rateDiv), false, 'Should have the rateDiv class');
|
71
|
-
assert.strictEqual(wrapper.childAt(1).hasClass(classes.spanIndicator), true, 'Should have the spanIndicator class');
|
72
|
-
});
|
73
|
-
});
|
@@ -1,48 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { createShallow } from '../test-utils';
|
4
|
-
import HiColoredLabel from '../HiColoredLabel';
|
5
|
-
import CellSentinel from './CellSentinel';
|
6
|
-
describe('<CellSentinel/>', function () {
|
7
|
-
var shallow;
|
8
|
-
before(function () {
|
9
|
-
shallow = createShallow({
|
10
|
-
dive: true
|
11
|
-
});
|
12
|
-
});
|
13
|
-
it('should render a div with 1 HiColoredLabel inside', function () {
|
14
|
-
var wrapper = shallow(React.createElement(CellSentinel, {
|
15
|
-
label: 'Acceptée',
|
16
|
-
letter: 'A',
|
17
|
-
color: '#00AF01'
|
18
|
-
}));
|
19
|
-
assert.strictEqual(wrapper.find(HiColoredLabel).length, 1);
|
20
|
-
});
|
21
|
-
it('should render a div with 1 HiColoredLabel active inside', function () {
|
22
|
-
var wrapper = shallow(React.createElement(CellSentinel, {
|
23
|
-
label: 'Acceptée',
|
24
|
-
letter: 'A',
|
25
|
-
color: '#00AF01',
|
26
|
-
active: true
|
27
|
-
}));
|
28
|
-
assert.strictEqual(wrapper.find(HiColoredLabel).length, 1);
|
29
|
-
});
|
30
|
-
it('should render a div with 1 HiColoredLabel outlined inside', function () {
|
31
|
-
var wrapper = shallow(React.createElement(CellSentinel, {
|
32
|
-
label: 'Acceptée',
|
33
|
-
letter: 'A',
|
34
|
-
color: '#00AF01',
|
35
|
-
outlined: true
|
36
|
-
}));
|
37
|
-
assert.strictEqual(wrapper.find(HiColoredLabel).length, 1);
|
38
|
-
});
|
39
|
-
it('should render a div with 1 HiColoredLabel with title inside', function () {
|
40
|
-
var wrapper = shallow(React.createElement(CellSentinel, {
|
41
|
-
label: 'Autorisée',
|
42
|
-
letter: 'A',
|
43
|
-
color: '#00AF01',
|
44
|
-
title: 'Autorisée par John Doe'
|
45
|
-
}));
|
46
|
-
assert.strictEqual(wrapper.find(HiColoredLabel).length, 1);
|
47
|
-
});
|
48
|
-
});
|
@@ -1,76 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { createShallow, getClasses } from '../test-utils';
|
4
|
-
import CellText from './CellText';
|
5
|
-
describe('<CellText />', function () {
|
6
|
-
var shallow;
|
7
|
-
var classes;
|
8
|
-
before(function () {
|
9
|
-
shallow = createShallow({
|
10
|
-
dive: true,
|
11
|
-
untilSelector: CellText,
|
12
|
-
context: {
|
13
|
-
table: {
|
14
|
-
footer: true
|
15
|
-
}
|
16
|
-
}
|
17
|
-
});
|
18
|
-
});
|
19
|
-
it('should render a div with label inside', function () {
|
20
|
-
var wrapper = shallow(React.createElement(CellText, {
|
21
|
-
type: 'text',
|
22
|
-
label: 'Test',
|
23
|
-
ellipsis: 'right',
|
24
|
-
displayTooltip: false
|
25
|
-
}));
|
26
|
-
assert.strictEqual(wrapper.find('div').text(), 'Test');
|
27
|
-
});
|
28
|
-
it('should render a div with 2 span (1 for label & 1 for ellipsis end)', function () {
|
29
|
-
var wrapper = shallow(React.createElement(CellText, {
|
30
|
-
type: 'text',
|
31
|
-
label: 'Q8A9LK6HICVYFSZ4',
|
32
|
-
view: 's',
|
33
|
-
ellipsis: 'middle',
|
34
|
-
ukey: 'cell_0_18',
|
35
|
-
displayTooltip: false
|
36
|
-
}));
|
37
|
-
assert.strictEqual(wrapper.find('span').length, 2);
|
38
|
-
assert.strictEqual(wrapper.find('span').at(0).text(), 'Q8A9LK6H', 'first part of label');
|
39
|
-
assert.strictEqual(wrapper.find('span').at(1).text(), 'ICVYFSZ4', 'last part of label');
|
40
|
-
});
|
41
|
-
it('should render a div with 2 span (1 for 1st word & 1 for the end)', function () {
|
42
|
-
var wrapper = shallow(React.createElement(CellText, {
|
43
|
-
type: 'text',
|
44
|
-
label: 'Test',
|
45
|
-
ellipsis: 'after-first-word'
|
46
|
-
}));
|
47
|
-
assert.strictEqual(wrapper.find('span').length, 2);
|
48
|
-
assert.strictEqual(wrapper.find('span').at(0).text(), 'Test ', 'first part of label');
|
49
|
-
assert.strictEqual(wrapper.find('span').at(1).text(), '', 'last part of label');
|
50
|
-
});
|
51
|
-
it('should render a div with 2 span (1 for 1st word & 1 for the end)', function () {
|
52
|
-
var wrapper = shallow(React.createElement(CellText, {
|
53
|
-
sticky: true,
|
54
|
-
type: 'text',
|
55
|
-
label: 'Test 2',
|
56
|
-
ellipsis: 'after-first-word'
|
57
|
-
}));
|
58
|
-
assert.strictEqual(wrapper.find('span').length, 2);
|
59
|
-
assert.strictEqual(wrapper.find('span').at(0).text(), 'Test ', 'first part of label');
|
60
|
-
assert.strictEqual(wrapper.find('span').at(1).text(), '2', 'last part of label');
|
61
|
-
});
|
62
|
-
it('should render a div with label', function () {
|
63
|
-
classes = getClasses(React.createElement(CellText, {
|
64
|
-
type: 'text',
|
65
|
-
label: 'Test',
|
66
|
-
ellipsis: 'left'
|
67
|
-
}));
|
68
|
-
var wrapper = shallow(React.createElement(CellText, {
|
69
|
-
type: 'text',
|
70
|
-
label: 'Test',
|
71
|
-
ellipsis: 'left'
|
72
|
-
}));
|
73
|
-
assert.strictEqual(wrapper.find('div').text(), 'Test');
|
74
|
-
assert.strictEqual(wrapper.find(".".concat(classes.leftEllipsisSpan)).length, 1, 'Should have 1 div with leftEllipsisSpanClass for content.');
|
75
|
-
});
|
76
|
-
});
|
@@ -1,55 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { spy } from 'sinon';
|
4
|
-
import { createMount, createShallow } from '../test-utils';
|
5
|
-
import Checkbox from '@material-ui/core/Checkbox';
|
6
|
-
import HiCheckbox from './HiCheckbox';
|
7
|
-
describe('<HiCheckbox/>', function () {
|
8
|
-
var shallow;
|
9
|
-
var mount;
|
10
|
-
beforeEach(function () {
|
11
|
-
shallow = createShallow({
|
12
|
-
dive: true
|
13
|
-
});
|
14
|
-
mount = createMount();
|
15
|
-
});
|
16
|
-
afterEach(function () {
|
17
|
-
mount.cleanUp();
|
18
|
-
});
|
19
|
-
it('Should render a Checkbox', function () {
|
20
|
-
var wrapper = shallow(React.createElement(HiCheckbox, null));
|
21
|
-
assert.strictEqual(wrapper.find(Checkbox).length, 1, 'render checkbox');
|
22
|
-
});
|
23
|
-
var event = {
|
24
|
-
target: {
|
25
|
-
checked: false
|
26
|
-
}
|
27
|
-
};
|
28
|
-
it('should call onChange exactly once with event', function () {
|
29
|
-
var onChangeSpy = spy();
|
30
|
-
var wrapper = mount(React.createElement(HiCheckbox, {
|
31
|
-
onChange: onChangeSpy
|
32
|
-
}));
|
33
|
-
assert.strictEqual(onChangeSpy.callCount, 0);
|
34
|
-
wrapper.find('input').simulate('change', event);
|
35
|
-
assert.strictEqual(onChangeSpy.callCount, 1);
|
36
|
-
assert.strictEqual(onChangeSpy.args[0][0].target, event.target);
|
37
|
-
onChangeSpy.resetHistory();
|
38
|
-
});
|
39
|
-
it('should call onChange exactly once with event', function () {
|
40
|
-
var onChangeSpy = spy();
|
41
|
-
var wrapper = mount(React.createElement(HiCheckbox, {
|
42
|
-
onChange: onChangeSpy
|
43
|
-
}));
|
44
|
-
assert.strictEqual(onChangeSpy.callCount, 0);
|
45
|
-
wrapper.find('input').simulate('change', null);
|
46
|
-
assert.strictEqual(onChangeSpy.callCount, 1);
|
47
|
-
onChangeSpy.resetHistory();
|
48
|
-
});
|
49
|
-
it('should mount', function () {
|
50
|
-
var wrapper = mount(React.createElement(HiCheckbox, {
|
51
|
-
onChange: undefined
|
52
|
-
}));
|
53
|
-
assert.strictEqual(wrapper.find(Checkbox).length, 1, 'render checkbox');
|
54
|
-
});
|
55
|
-
});
|
package/es/HiChip/HiChip.test.js
DELETED
@@ -1,136 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { spy } from 'sinon';
|
4
|
-
import { createShallow, createMount, getClasses } from '../test-utils';
|
5
|
-
import HiChip from './HiChip';
|
6
|
-
import HiIcon from '../HiIcon';
|
7
|
-
describe('<HiChip />', function () {
|
8
|
-
var shallow;
|
9
|
-
var mount;
|
10
|
-
var classes;
|
11
|
-
var wrapper;
|
12
|
-
|
13
|
-
var noop = function noop() {};
|
14
|
-
|
15
|
-
before(function () {
|
16
|
-
shallow = createShallow({
|
17
|
-
untilSelector: 'Badge'
|
18
|
-
});
|
19
|
-
mount = createMount();
|
20
|
-
classes = getClasses(React.createElement(HiChip, {
|
21
|
-
label: "test"
|
22
|
-
}));
|
23
|
-
});
|
24
|
-
after(function () {
|
25
|
-
mount.cleanUp();
|
26
|
-
});
|
27
|
-
describe('Basic chip', function () {
|
28
|
-
before(function () {
|
29
|
-
wrapper = shallow(React.createElement(HiChip, {
|
30
|
-
label: "test"
|
31
|
-
}));
|
32
|
-
});
|
33
|
-
it('should render a div containing a span and an icon', function () {
|
34
|
-
assert.strictEqual(wrapper.name(), 'div');
|
35
|
-
assert.strictEqual(wrapper.childAt(0).is('span'), true, 'should be a span');
|
36
|
-
assert.strictEqual(wrapper.find(HiIcon).length, 0, 'should not have deletable icon');
|
37
|
-
});
|
38
|
-
it('should merge user classes & spread custom props to the root node', function () {
|
39
|
-
assert.strictEqual(wrapper.hasClass(classes.root), true);
|
40
|
-
});
|
41
|
-
});
|
42
|
-
describe('Chip with icon', function () {
|
43
|
-
before(function () {
|
44
|
-
wrapper = shallow(React.createElement(HiChip, {
|
45
|
-
label: "test",
|
46
|
-
icon: "magnify"
|
47
|
-
}));
|
48
|
-
});
|
49
|
-
it('should render a div containing a span', function () {
|
50
|
-
assert.strictEqual(wrapper.name(), 'div');
|
51
|
-
assert.strictEqual(wrapper.childAt(0).is(HiIcon), true, 'should be a HiIcon');
|
52
|
-
assert.strictEqual(wrapper.childAt(1).is('span'), true, 'should be a span');
|
53
|
-
});
|
54
|
-
});
|
55
|
-
describe('Chip with img', function () {
|
56
|
-
before(function () {
|
57
|
-
wrapper = shallow(React.createElement(HiChip, {
|
58
|
-
label: "test",
|
59
|
-
img: "/static/hmus/images/countries/ag.svg"
|
60
|
-
}));
|
61
|
-
});
|
62
|
-
it('should render a div containing an img and a span', function () {
|
63
|
-
assert.strictEqual(wrapper.name(), 'div');
|
64
|
-
assert.strictEqual(wrapper.childAt(0).is('img'), true, 'should be a img');
|
65
|
-
assert.strictEqual(wrapper.childAt(1).is('span'), true, 'should be a span');
|
66
|
-
});
|
67
|
-
});
|
68
|
-
describe('Chip with icon and navigable', function () {
|
69
|
-
before(function () {
|
70
|
-
wrapper = shallow(React.createElement(HiChip, {
|
71
|
-
label: "test",
|
72
|
-
icon: "magnify",
|
73
|
-
onNext: noop,
|
74
|
-
onPrevious: noop
|
75
|
-
}));
|
76
|
-
});
|
77
|
-
it('should render a div containing a span', function () {
|
78
|
-
assert.strictEqual(wrapper.name(), 'div');
|
79
|
-
assert.strictEqual(wrapper.childAt(0).is(HiIcon), true, 'should be a HiIcon (icon)');
|
80
|
-
assert.strictEqual(wrapper.childAt(1).is(HiIcon), true, 'should be a HiIcon (previous)');
|
81
|
-
assert.strictEqual(wrapper.childAt(2).is('span'), true, 'should be a span');
|
82
|
-
assert.strictEqual(wrapper.childAt(3).is(HiIcon), true, 'should be a HiIcon (next)');
|
83
|
-
});
|
84
|
-
it('should merge user classes & spread custom props to the root node', function () {
|
85
|
-
assert.strictEqual(wrapper.hasClass(classes.root), true);
|
86
|
-
});
|
87
|
-
});
|
88
|
-
describe('Chip with icon and navigable and delete', function () {
|
89
|
-
before(function () {
|
90
|
-
wrapper = shallow(React.createElement(HiChip, {
|
91
|
-
label: "test",
|
92
|
-
icon: "magnify",
|
93
|
-
onNext: noop,
|
94
|
-
onPrevious: noop,
|
95
|
-
onDelete: noop
|
96
|
-
}));
|
97
|
-
});
|
98
|
-
it('should render all components', function () {
|
99
|
-
assert.strictEqual(wrapper.name(), 'div');
|
100
|
-
assert.strictEqual(wrapper.childAt(0).is(HiIcon), true, 'should be a HiIcon (icon)');
|
101
|
-
assert.strictEqual(wrapper.childAt(1).is(HiIcon), true, 'should be a HiIcon (previous)');
|
102
|
-
assert.strictEqual(wrapper.childAt(2).is('span'), true, 'should be a span');
|
103
|
-
assert.strictEqual(wrapper.childAt(3).is(HiIcon), true, 'should be a HiIcon (next)');
|
104
|
-
assert.strictEqual(wrapper.childAt(4).is(HiIcon), true, 'should be a HiIcon (delete)');
|
105
|
-
});
|
106
|
-
it('should merge user classes & spread custom props to the root node', function () {
|
107
|
-
assert.strictEqual(wrapper.hasClass(classes.root), true);
|
108
|
-
});
|
109
|
-
});
|
110
|
-
describe('delete icon', function () {
|
111
|
-
it('should call onDelete when clicking', function () {
|
112
|
-
var handleDelete = spy();
|
113
|
-
var handleNext = spy();
|
114
|
-
var handlePrevious = spy();
|
115
|
-
wrapper = shallow(React.createElement(HiChip, {
|
116
|
-
label: "test",
|
117
|
-
onDelete: handleDelete,
|
118
|
-
onPrevious: handlePrevious,
|
119
|
-
onNext: handleNext
|
120
|
-
}));
|
121
|
-
wrapper.find(HiIcon).at(0).simulate('click');
|
122
|
-
assert.strictEqual(handlePrevious.callCount, 1, 'should have been called once handlePrevious');
|
123
|
-
assert.strictEqual(handleNext.callCount, 0, 'should not have been called handleNext');
|
124
|
-
assert.strictEqual(handleDelete.callCount, 0, 'should not have been called handleDelete');
|
125
|
-
wrapper.find(HiIcon).at(1).simulate('click');
|
126
|
-
assert.strictEqual(handlePrevious.callCount, 1, 'should have been called once handlePrevious');
|
127
|
-
assert.strictEqual(handleNext.callCount, 1, 'should have been called once handleNext');
|
128
|
-
assert.strictEqual(handleDelete.callCount, 0, 'should not have been called handleDelete');
|
129
|
-
wrapper.find(HiIcon).at(2).simulate('click');
|
130
|
-
assert.strictEqual(handlePrevious.callCount, 1, 'should have been called once handlePrevious');
|
131
|
-
assert.strictEqual(handleNext.callCount, 1, 'should have been called once handleNext');
|
132
|
-
assert.strictEqual(handleDelete.callCount, 1, 'should have been called once handleDelete');
|
133
|
-
wrapper.unmount();
|
134
|
-
});
|
135
|
-
});
|
136
|
-
});
|
@@ -1,99 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { spy } from 'sinon';
|
4
|
-
import { createShallow, createMount, getClasses } from '../test-utils';
|
5
|
-
import HiChipSwitch from './HiChipSwitch';
|
6
|
-
import HiIcon from '../HiIcon';
|
7
|
-
describe('<HiChipSwitch />', function () {
|
8
|
-
var shallow;
|
9
|
-
var mount;
|
10
|
-
var classes;
|
11
|
-
var wrapper;
|
12
|
-
|
13
|
-
var noop = function noop() {};
|
14
|
-
|
15
|
-
before(function () {
|
16
|
-
shallow = createShallow({
|
17
|
-
untilSelector: 'Badge'
|
18
|
-
});
|
19
|
-
mount = createMount();
|
20
|
-
classes = getClasses(React.createElement(HiChipSwitch, {
|
21
|
-
label: "test",
|
22
|
-
onClick: noop
|
23
|
-
}));
|
24
|
-
});
|
25
|
-
after(function () {
|
26
|
-
mount.cleanUp();
|
27
|
-
});
|
28
|
-
describe('text with leftIcon', function () {
|
29
|
-
before(function () {
|
30
|
-
wrapper = shallow(React.createElement(HiChipSwitch, {
|
31
|
-
label: "test",
|
32
|
-
onClick: noop
|
33
|
-
}));
|
34
|
-
});
|
35
|
-
it('should render a div containing a span and an icon', function () {
|
36
|
-
assert.strictEqual(wrapper.name(), 'div');
|
37
|
-
assert.strictEqual(wrapper.childAt(0).is(HiIcon), true, 'should be a HiIcon');
|
38
|
-
assert.strictEqual(wrapper.childAt(1).is('span'), true, 'should be a span');
|
39
|
-
});
|
40
|
-
it('should merge user classes & spread custom props to the root node', function () {
|
41
|
-
assert.strictEqual(wrapper.hasClass(classes.root), true);
|
42
|
-
});
|
43
|
-
});
|
44
|
-
describe('text with leftIcon and selection', function () {
|
45
|
-
before(function () {
|
46
|
-
wrapper = shallow(React.createElement(HiChipSwitch, {
|
47
|
-
label: "test",
|
48
|
-
selection: 5,
|
49
|
-
onClick: noop
|
50
|
-
}));
|
51
|
-
});
|
52
|
-
it('should render a div containing a span', function () {
|
53
|
-
assert.strictEqual(wrapper.name(), 'div');
|
54
|
-
assert.strictEqual(wrapper.childAt(0).is(HiIcon), true, 'should be a HiIcon (leftIcon)');
|
55
|
-
assert.strictEqual(wrapper.childAt(1).is('span'), true, 'should be a span');
|
56
|
-
assert.strictEqual(wrapper.childAt(2).is('div'), true, 'should be a div');
|
57
|
-
});
|
58
|
-
it('should merge user classes & spread custom props to the root node', function () {
|
59
|
-
assert.strictEqual(wrapper.hasClass(classes.root), true);
|
60
|
-
});
|
61
|
-
});
|
62
|
-
describe('callbacks', function () {
|
63
|
-
it('should call onDelete when clicking', function () {
|
64
|
-
var handleClick = spy();
|
65
|
-
var handleSelectionClick = spy();
|
66
|
-
wrapper = shallow(React.createElement(HiChipSwitch, {
|
67
|
-
label: "test",
|
68
|
-
onClick: handleClick,
|
69
|
-
onSelectionClick: handleSelectionClick,
|
70
|
-
selection: 5
|
71
|
-
}));
|
72
|
-
wrapper.simulate('click');
|
73
|
-
assert.strictEqual(handleClick.callCount, 1, 'should have been called once handleClick');
|
74
|
-
assert.strictEqual(handleSelectionClick.callCount, 0, 'should not have been called handleSelectionClick');
|
75
|
-
assert.strictEqual(wrapper.find(HiIcon).length, 1, 'should have default icon');
|
76
|
-
wrapper.setProps({
|
77
|
-
active: true
|
78
|
-
});
|
79
|
-
wrapper.update();
|
80
|
-
assert.strictEqual(wrapper.find(HiIcon).length, 1, 'should have default active icon');
|
81
|
-
wrapper.setProps({
|
82
|
-
activeIcon: 'search'
|
83
|
-
});
|
84
|
-
wrapper.update();
|
85
|
-
assert.strictEqual(wrapper.find(HiIcon).length, 1, 'should have specific active icon');
|
86
|
-
wrapper.find('div').at(1).simulate('click');
|
87
|
-
assert.strictEqual(handleSelectionClick.callCount, 1, 'should have been called once handleSelectionClick');
|
88
|
-
wrapper.unmount();
|
89
|
-
wrapper = mount(React.createElement(HiChipSwitch, {
|
90
|
-
label: "test",
|
91
|
-
onClick: handleClick,
|
92
|
-
selection: 5
|
93
|
-
}));
|
94
|
-
wrapper.find('div').at(1).simulate('click');
|
95
|
-
assert.strictEqual(handleSelectionClick.callCount, 1, 'should not have been called handleSelectionClick');
|
96
|
-
wrapper.unmount();
|
97
|
-
});
|
98
|
-
});
|
99
|
-
});
|
@@ -1,96 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { assert } from 'chai';
|
3
|
-
import { createShallow, createMount, getClasses } from '../test-utils';
|
4
|
-
import HiColoredLabel from './HiColoredLabel';
|
5
|
-
describe('<HiColoredLabel />', function () {
|
6
|
-
var shallow;
|
7
|
-
var classes;
|
8
|
-
var mount;
|
9
|
-
before(function () {
|
10
|
-
shallow = createShallow({
|
11
|
-
dive: true
|
12
|
-
});
|
13
|
-
classes = getClasses(React.createElement(HiColoredLabel, {
|
14
|
-
label: "",
|
15
|
-
color: ""
|
16
|
-
}));
|
17
|
-
mount = createMount();
|
18
|
-
});
|
19
|
-
after(function () {
|
20
|
-
mount.cleanUp();
|
21
|
-
});
|
22
|
-
describe('color text only', function () {
|
23
|
-
var wrapper;
|
24
|
-
before(function () {
|
25
|
-
wrapper = shallow(React.createElement(HiColoredLabel, {
|
26
|
-
label: 'Test Label',
|
27
|
-
color: '#e4e4e4',
|
28
|
-
fontWeight: 600
|
29
|
-
}));
|
30
|
-
});
|
31
|
-
it('should render a div with classes root', function () {
|
32
|
-
assert.strictEqual(wrapper.name(), 'div');
|
33
|
-
assert.strictEqual(wrapper.hasClass(classes.root), true);
|
34
|
-
});
|
35
|
-
it('should have color and background opacity 0.08', function () {
|
36
|
-
assert.strictEqual(wrapper.props().style.backgroundColor, 'rgba(228, 228, 228, 0.08)');
|
37
|
-
assert.strictEqual(wrapper.props().style.color, '#e4e4e4');
|
38
|
-
assert.strictEqual(wrapper.props().style.fontWeight, 600);
|
39
|
-
});
|
40
|
-
});
|
41
|
-
describe('active color text', function () {
|
42
|
-
var wrapper;
|
43
|
-
before(function () {
|
44
|
-
wrapper = shallow(React.createElement(HiColoredLabel, {
|
45
|
-
label: 'Test Label',
|
46
|
-
color: '#e4e4e4',
|
47
|
-
active: true
|
48
|
-
}));
|
49
|
-
});
|
50
|
-
it('should render a div with classes root', function () {
|
51
|
-
assert.strictEqual(wrapper.name(), 'div');
|
52
|
-
assert.strictEqual(wrapper.hasClass(classes.root), true);
|
53
|
-
});
|
54
|
-
it('should have color and background opacity 0.08', function () {
|
55
|
-
assert.strictEqual(wrapper.props().style.backgroundColor, '#e4e4e4');
|
56
|
-
assert.strictEqual(wrapper.props().style.color, '#20272B');
|
57
|
-
});
|
58
|
-
});
|
59
|
-
describe('beta active color text', function () {
|
60
|
-
var wrapper;
|
61
|
-
before(function () {
|
62
|
-
wrapper = shallow(React.createElement(HiColoredLabel, {
|
63
|
-
label: 'Test Label',
|
64
|
-
color: '#e4e4e4',
|
65
|
-
active: true,
|
66
|
-
beta: true
|
67
|
-
}));
|
68
|
-
});
|
69
|
-
it('should render a div with classes root', function () {
|
70
|
-
assert.strictEqual(wrapper.name(), 'div');
|
71
|
-
assert.strictEqual(wrapper.hasClass(classes.root), true);
|
72
|
-
});
|
73
|
-
it('should have color and background opacity 0.08', function () {
|
74
|
-
assert.strictEqual(wrapper.props().style.backgroundColor, '#e4e4e4');
|
75
|
-
assert.strictEqual(wrapper.props().style.color, '#20272B');
|
76
|
-
});
|
77
|
-
});
|
78
|
-
describe('null color', function () {
|
79
|
-
var wrapper;
|
80
|
-
before(function () {
|
81
|
-
wrapper = shallow(React.createElement(HiColoredLabel, {
|
82
|
-
label: 'Test Label',
|
83
|
-
color: null,
|
84
|
-
active: true
|
85
|
-
}));
|
86
|
-
});
|
87
|
-
it('should render a div with classes root', function () {
|
88
|
-
assert.strictEqual(wrapper.name(), 'div');
|
89
|
-
assert.strictEqual(wrapper.hasClass(classes.root), true);
|
90
|
-
});
|
91
|
-
it('should have color and background opacity 0.08', function () {
|
92
|
-
assert.strictEqual(wrapper.props().style.backgroundColor, undefined);
|
93
|
-
assert.strictEqual(wrapper.props().style.color, undefined);
|
94
|
-
});
|
95
|
-
});
|
96
|
-
});
|