@transferwise/components 46.94.1 → 46.95.0
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/build/accordion/Accordion.js +4 -2
- package/build/accordion/Accordion.js.map +1 -1
- package/build/accordion/AccordionItem/AccordionItem.js +6 -4
- package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
- package/build/actionButton/ActionButton.js +3 -1
- package/build/actionButton/ActionButton.js.map +1 -1
- package/build/actionOption/ActionOption.js +5 -3
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/alert/Alert.js +4 -4
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.js +4 -2
- package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
- package/build/avatar/Avatar.js +3 -1
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatarLayout/AvatarLayout.js +5 -3
- package/build/avatarLayout/AvatarLayout.js.map +1 -1
- package/build/avatarView/AvatarView.js +9 -7
- package/build/avatarView/AvatarView.js.map +1 -1
- package/build/avatarView/NotificationDot.js +3 -1
- package/build/avatarView/NotificationDot.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.js +8 -6
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs +1 -1
- package/build/avatarWrapper/index.js +3 -1
- package/build/avatarWrapper/index.js.map +1 -1
- package/build/badge/Badge.js +3 -1
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs.map +1 -1
- package/build/badge/BadgeAssets.js +9 -7
- package/build/badge/BadgeAssets.js.map +1 -1
- package/build/badge/BadgeAssets.mjs +2 -2
- package/build/badge/BadgeAssets.mjs.map +1 -1
- package/build/body/Body.js +3 -1
- package/build/body/Body.js.map +1 -1
- package/build/button/Button.js +8 -6
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.resolver.js +5 -3
- package/build/button/Button.resolver.js.map +1 -1
- package/build/button/LegacyButton.js +5 -3
- package/build/button/LegacyButton.js.map +1 -1
- package/build/card/Card.js +6 -4
- package/build/card/Card.js.map +1 -1
- package/build/carousel/Carousel.js +7 -5
- package/build/carousel/Carousel.js.map +1 -1
- package/build/checkbox/Checkbox.js +6 -4
- package/build/checkbox/Checkbox.js.map +1 -1
- package/build/checkboxButton/CheckboxButton.js +3 -1
- package/build/checkboxButton/CheckboxButton.js.map +1 -1
- package/build/checkboxOption/CheckboxOption.js +5 -3
- package/build/checkboxOption/CheckboxOption.js.map +1 -1
- package/build/chevron/Chevron.js +3 -1
- package/build/chevron/Chevron.js.map +1 -1
- package/build/chips/Chip.js +4 -2
- package/build/chips/Chip.js.map +1 -1
- package/build/chips/Chips.js +5 -3
- package/build/chips/Chips.js.map +1 -1
- package/build/chips/Chips.messages.js +3 -1
- package/build/chips/Chips.messages.js.map +1 -1
- package/build/circularButton/CircularButton.js +5 -3
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/common/Option/Option.js +7 -5
- package/build/common/Option/Option.js.map +1 -1
- package/build/common/Option/Option.mjs +2 -2
- package/build/common/Option/Option.mjs.map +1 -1
- package/build/common/RadioButton/RadioButton.js +3 -1
- package/build/common/RadioButton/RadioButton.js.map +1 -1
- package/build/common/action/Action.js +2 -2
- package/build/common/action/Action.js.map +1 -1
- package/build/common/bottomSheet/BottomSheet.js +4 -2
- package/build/common/bottomSheet/BottomSheet.js.map +1 -1
- package/build/common/card/Card.js +3 -1
- package/build/common/card/Card.js.map +1 -1
- package/build/common/circle/Circle.js +3 -1
- package/build/common/circle/Circle.js.map +1 -1
- package/build/common/closeButton/CloseButton.js +1 -1
- package/build/common/closeButton/CloseButton.js.map +1 -1
- package/build/common/closeButton/CloseButton.messages.js +3 -1
- package/build/common/closeButton/CloseButton.messages.js.map +1 -1
- package/build/common/flowHeader/FlowHeader.js +3 -1
- package/build/common/flowHeader/FlowHeader.js.map +1 -1
- package/build/common/focusBoundary/FocusBoundary.js +3 -1
- package/build/common/focusBoundary/FocusBoundary.js.map +1 -1
- package/build/common/historyNavigator/historyNavigator.js +3 -1
- package/build/common/historyNavigator/historyNavigator.js.map +1 -1
- package/build/common/locale/index.js +0 -24
- package/build/common/locale/index.js.map +1 -1
- package/build/common/locale/index.mjs +0 -24
- package/build/common/locale/index.mjs.map +1 -1
- package/build/common/panel/Panel.js +3 -1
- package/build/common/panel/Panel.js.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.js +5 -3
- package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
- package/build/common/textFormat/formatWithPattern/formatWithPattern.js +4 -2
- package/build/common/textFormat/formatWithPattern/formatWithPattern.js.map +1 -1
- package/build/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +4 -2
- package/build/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js.map +1 -1
- package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +4 -2
- package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js.map +1 -1
- package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +2 -2
- package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js.map +1 -1
- package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +3 -1
- package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js.map +1 -1
- package/build/common/textFormat/unformatWithPattern/unformatWithPattern.js +3 -1
- package/build/common/textFormat/unformatWithPattern/unformatWithPattern.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +3 -1
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/dateInput/DateInput.js +15 -13
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.messages.js +3 -1
- package/build/dateInput/DateInput.messages.js.map +1 -1
- package/build/dateInput/DateInput.mjs +3 -3
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/dateLookup/DateLookup.js +8 -6
- package/build/dateLookup/DateLookup.js.map +1 -1
- package/build/dateLookup/DateLookup.messages.js +3 -1
- package/build/dateLookup/DateLookup.messages.js.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.js +33 -26
- package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs +27 -22
- package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.js +8 -6
- package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.messages.js +4 -2
- package/build/dateLookup/dateTrigger/DateTrigger.messages.js.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.messages.mjs +2 -2
- package/build/dateLookup/dateTrigger/DateTrigger.messages.mjs.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.mjs +2 -2
- package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -1
- package/build/dateLookup/dayCalendar/DayCalendar.js +6 -4
- package/build/dateLookup/dayCalendar/DayCalendar.js.map +1 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -2
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -1
- package/build/dateLookup/monthCalendar/MonthCalendar.js +6 -4
- package/build/dateLookup/monthCalendar/MonthCalendar.js.map +1 -1
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js +4 -2
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +1 -1
- package/build/dateLookup/tableLink/TableLink.js +4 -2
- package/build/dateLookup/tableLink/TableLink.js.map +1 -1
- package/build/dateLookup/yearCalendar/YearCalendar.js +6 -4
- package/build/dateLookup/yearCalendar/YearCalendar.js.map +1 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.js +4 -2
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +1 -1
- package/build/decision/Decision.js +2 -2
- package/build/decision/Decision.js.map +1 -1
- package/build/definitionList/DefinitionList.js +4 -2
- package/build/definitionList/DefinitionList.js.map +1 -1
- package/build/dimmer/Dimmer.js +3 -3
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/dimmerManager/DimmerManager.js +3 -1
- package/build/dimmer/dimmerManager/DimmerManager.js.map +1 -1
- package/build/display/Display.js +3 -1
- package/build/display/Display.js.map +1 -1
- package/build/divider/Divider.js +35 -0
- package/build/divider/Divider.js.map +1 -0
- package/build/divider/Divider.mjs +31 -0
- package/build/divider/Divider.mjs.map +1 -0
- package/build/drawer/Drawer.js +4 -2
- package/build/drawer/Drawer.js.map +1 -1
- package/build/dropFade/DropFade.js +3 -1
- package/build/dropFade/DropFade.js.map +1 -1
- package/build/emphasis/Emphasis.js +4 -2
- package/build/emphasis/Emphasis.js.map +1 -1
- package/build/emphasis/EmphasisHtmlTransformer.js +3 -1
- package/build/emphasis/EmphasisHtmlTransformer.js.map +1 -1
- package/build/field/Field.js +1 -1
- package/build/field/Field.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.js +8 -6
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.messages.js +3 -1
- package/build/flowNavigation/FlowNavigation.messages.js.map +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.js +5 -3
- package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
- package/build/header/Header.js +4 -4
- package/build/header/Header.js.map +1 -1
- package/build/i18n/commonMessages/Button.messages.js +3 -1
- package/build/i18n/commonMessages/Button.messages.js.map +1 -1
- package/build/i18n/cs.json +22 -5
- package/build/i18n/cs.json.js +25 -6
- package/build/i18n/cs.json.js.map +1 -1
- package/build/i18n/cs.json.mjs +22 -5
- package/build/i18n/cs.json.mjs.map +1 -1
- package/build/i18n/de.json.js +3 -1
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/en.json.js +3 -1
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/es.json.js +3 -1
- package/build/i18n/es.json.js.map +1 -1
- package/build/i18n/fr.json.js +3 -1
- package/build/i18n/fr.json.js.map +1 -1
- package/build/i18n/hu.json.js +3 -1
- package/build/i18n/hu.json.js.map +1 -1
- package/build/i18n/id.json.js +3 -1
- package/build/i18n/id.json.js.map +1 -1
- package/build/i18n/index.js +22 -20
- package/build/i18n/index.js.map +1 -1
- package/build/i18n/it.json.js +3 -1
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/ja.json.js +3 -1
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/nl.json +73 -0
- package/build/i18n/pl.json.js +3 -1
- package/build/i18n/pl.json.js.map +1 -1
- package/build/i18n/pt.json.js +3 -1
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/ro.json.js +3 -1
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ru.json.js +3 -1
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/th.json.js +3 -1
- package/build/i18n/th.json.js.map +1 -1
- package/build/i18n/tr.json.js +3 -1
- package/build/i18n/tr.json.js.map +1 -1
- package/build/i18n/uk.json.js +3 -1
- package/build/i18n/uk.json.js.map +1 -1
- package/build/i18n/zh-CN.json.js +3 -1
- package/build/i18n/zh-CN.json.js.map +1 -1
- package/build/i18n/zh-HK.json.js +3 -1
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/iconButton/IconButton.js +5 -3
- package/build/iconButton/IconButton.js.map +1 -1
- package/build/index.js +84 -82
- package/build/index.js.map +1 -1
- package/build/index.mjs +3 -2
- package/build/index.mjs.map +1 -1
- package/build/info/Info.js +8 -6
- package/build/info/Info.js.map +1 -1
- package/build/info/Info.messages.js +3 -1
- package/build/info/Info.messages.js.map +1 -1
- package/build/inlineAlert/InlineAlert.js +5 -3
- package/build/inlineAlert/InlineAlert.js.map +1 -1
- package/build/inputWithDisplayFormat/InputWithDisplayFormat.js +4 -2
- package/build/inputWithDisplayFormat/InputWithDisplayFormat.js.map +1 -1
- package/build/inputs/SelectInput.js +3 -3
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.messages.js +3 -1
- package/build/inputs/SelectInput.messages.js.map +1 -1
- package/build/inputs/SelectInput.mjs +2 -2
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/instructionsList/InstructionsList.js +4 -2
- package/build/instructionsList/InstructionsList.js.map +1 -1
- package/build/label/Label.js +3 -3
- package/build/label/Label.js.map +1 -1
- package/build/label/Label.messages.js +3 -1
- package/build/label/Label.messages.js.map +1 -1
- package/build/link/Link.js +5 -3
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.messages.js +3 -1
- package/build/link/Link.messages.js.map +1 -1
- package/build/listItem/ListItem.js +5 -3
- package/build/listItem/ListItem.js.map +1 -1
- package/build/loader/Loader.js +3 -1
- package/build/loader/Loader.js.map +1 -1
- package/build/main.css +27 -8
- package/build/markdown/Markdown.js +3 -1
- package/build/markdown/Markdown.js.map +1 -1
- package/build/modal/Modal.js +5 -3
- package/build/modal/Modal.js.map +1 -1
- package/build/money/Money.js +3 -1
- package/build/money/Money.js.map +1 -1
- package/build/moneyInput/MoneyInput.js +7 -5
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.js +3 -1
- package/build/moneyInput/MoneyInput.messages.js.map +1 -1
- package/build/navigationOption/NavigationOption.js +5 -3
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOptionsList/NavigationOptionsList.js +3 -1
- package/build/navigationOptionsList/NavigationOptionsList.js.map +1 -1
- package/build/nudge/Nudge.js +2 -2
- package/build/nudge/Nudge.js.map +1 -1
- package/build/overlayHeader/OverlayHeader.js +4 -2
- package/build/overlayHeader/OverlayHeader.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +5 -3
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.messages.js +3 -1
- package/build/phoneNumberInput/PhoneNumberInput.messages.js.map +1 -1
- package/build/phoneNumberInput/data/countries.js +3 -1
- package/build/phoneNumberInput/data/countries.js.map +1 -1
- package/build/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
- package/build/phoneNumberInput/utils/findCountryByCode/index.js.map +1 -1
- package/build/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
- package/build/phoneNumberInput/utils/findCountryByPrefix/index.js.map +1 -1
- package/build/popover/Popover.js +5 -3
- package/build/popover/Popover.js.map +1 -1
- package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.js +3 -1
- package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.js.map +1 -1
- package/build/primitives/PrimitiveButton/PrimitiveButton.js +4 -2
- package/build/primitives/PrimitiveButton/PrimitiveButton.js.map +1 -1
- package/build/processIndicator/ProcessIndicator.js +3 -1
- package/build/processIndicator/ProcessIndicator.js.map +1 -1
- package/build/progress/Progress.js +3 -1
- package/build/progress/Progress.js.map +1 -1
- package/build/progressBar/ProgressBar.js +7 -5
- package/build/progressBar/ProgressBar.js.map +1 -1
- package/build/promoCard/PromoCard.js +8 -6
- package/build/promoCard/PromoCard.js.map +1 -1
- package/build/promoCard/PromoCardGroup.js +3 -1
- package/build/promoCard/PromoCardGroup.js.map +1 -1
- package/build/promoCard/PromoCardIndicator.js +5 -3
- package/build/promoCard/PromoCardIndicator.js.map +1 -1
- package/build/provider/Provider.js +4 -2
- package/build/provider/Provider.js.map +1 -1
- package/build/radio/Radio.js +6 -4
- package/build/radio/Radio.js.map +1 -1
- package/build/radioGroup/RadioGroup.js +4 -2
- package/build/radioGroup/RadioGroup.js.map +1 -1
- package/build/radioOption/RadioOption.js +5 -3
- package/build/radioOption/RadioOption.js.map +1 -1
- package/build/section/Section.js +3 -1
- package/build/section/Section.js.map +1 -1
- package/build/segmentedControl/SegmentedControl.js +5 -3
- package/build/segmentedControl/SegmentedControl.js.map +1 -1
- package/build/select/Select.js +13 -11
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.messages.js +3 -1
- package/build/select/Select.messages.js.map +1 -1
- package/build/select/option/Option.js +6 -4
- package/build/select/option/Option.js.map +1 -1
- package/build/select/option/index.js +3 -1
- package/build/select/option/index.js.map +1 -1
- package/build/select/searchBox/SearchBox.js +3 -1
- package/build/select/searchBox/SearchBox.js.map +1 -1
- package/build/selectOption/SelectOption.js +10 -8
- package/build/selectOption/SelectOption.js.map +1 -1
- package/build/selectOption/SelectOption.messages.js +3 -1
- package/build/selectOption/SelectOption.messages.js.map +1 -1
- package/build/snackbar/Snackbar.js +3 -3
- package/build/snackbar/Snackbar.js.map +1 -1
- package/build/snackbar/SnackbarProvider.js +3 -1
- package/build/snackbar/SnackbarProvider.js.map +1 -1
- package/build/snackbar/useSnackbar.js +3 -1
- package/build/snackbar/useSnackbar.js.map +1 -1
- package/build/statusIcon/StatusIcon.js +12 -10
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.messages.js +3 -1
- package/build/statusIcon/StatusIcon.messages.js.map +1 -1
- package/build/stepper/Stepper.js +4 -2
- package/build/stepper/Stepper.js.map +1 -1
- package/build/sticky/Sticky.js +3 -1
- package/build/sticky/Sticky.js.map +1 -1
- package/build/styles/button/Button.css +2 -2
- package/build/styles/common/Option/Option.css +1 -1
- package/build/styles/dateLookup/DateLookup.css +0 -5
- package/build/styles/divider/Divider.css +24 -0
- package/build/styles/main.css +27 -8
- package/build/summary/Summary.js +9 -7
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.messages.js +3 -1
- package/build/summary/Summary.messages.js.map +1 -1
- package/build/switch/Switch.js +3 -1
- package/build/switch/Switch.js.map +1 -1
- package/build/switchOption/SwitchOption.js +5 -3
- package/build/switchOption/SwitchOption.js.map +1 -1
- package/build/table/Table.js +16 -14
- package/build/table/Table.js.map +1 -1
- package/build/table/Table.messages.js +3 -1
- package/build/table/Table.messages.js.map +1 -1
- package/build/table/TableCell.js +9 -7
- package/build/table/TableCell.js.map +1 -1
- package/build/table/TableHeader.js +6 -4
- package/build/table/TableHeader.js.map +1 -1
- package/build/table/TableRow.js +6 -4
- package/build/table/TableRow.js.map +1 -1
- package/build/table/TableStatusText.js +4 -2
- package/build/table/TableStatusText.js.map +1 -1
- package/build/tabs/Tab.js +3 -1
- package/build/tabs/Tab.js.map +1 -1
- package/build/tabs/TabList.js +3 -1
- package/build/tabs/TabList.js.map +1 -1
- package/build/tabs/TabPanel.js +3 -1
- package/build/tabs/TabPanel.js.map +1 -1
- package/build/tabs/Tabs.js +6 -4
- package/build/tabs/Tabs.js.map +1 -1
- package/build/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +4 -2
- package/build/textareaWithDisplayFormat/TextareaWithDisplayFormat.js.map +1 -1
- package/build/tile/Tile.js +5 -3
- package/build/tile/Tile.js.map +1 -1
- package/build/title/Title.js +3 -1
- package/build/title/Title.js.map +1 -1
- package/build/tooltip/Tooltip.js +3 -1
- package/build/tooltip/Tooltip.js.map +1 -1
- package/build/typeahead/Typeahead.js +8 -6
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.messages.js +3 -1
- package/build/typeahead/Typeahead.messages.js.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.js +3 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.js.map +1 -1
- package/build/typeahead/typeaheadOption/TypeaheadOption.js +5 -3
- package/build/typeahead/typeaheadOption/TypeaheadOption.js.map +1 -1
- package/build/typeahead/util/highlight.js +3 -1
- package/build/typeahead/util/highlight.js.map +1 -1
- package/build/types/badge/Badge.d.ts +1 -1
- package/build/types/badge/Badge.d.ts.map +1 -1
- package/build/types/badge/BadgeAssets.d.ts.map +1 -1
- package/build/types/common/locale/index.d.ts +1 -1
- package/build/types/common/locale/index.d.ts.map +1 -1
- package/build/types/dateInput/DateInput.d.ts +1 -1
- package/build/types/dateInput/DateInput.d.ts.map +1 -1
- package/build/types/dateLookup/dateHeader/DateHeader.d.ts.map +1 -1
- package/build/types/divider/Divider.d.ts +29 -0
- package/build/types/divider/Divider.d.ts.map +1 -0
- package/build/types/divider/index.d.ts +3 -0
- package/build/types/divider/index.d.ts.map +1 -0
- package/build/types/index.d.ts +2 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/upload/Upload.d.ts.map +1 -1
- package/build/upload/Upload.js +20 -18
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.messages.js +3 -1
- package/build/upload/Upload.messages.js.map +1 -1
- package/build/upload/Upload.mjs +3 -1
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/completeStep/completeStep.js +30 -6
- package/build/upload/steps/completeStep/completeStep.js.map +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs +24 -2
- package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
- package/build/upload/steps/processingStep/processingStep.js +6 -4
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +5 -3
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
- package/build/uploadInput/UploadInput.js +13 -11
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.messages.js +3 -1
- package/build/uploadInput/UploadInput.messages.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js +8 -8
- package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.messages.js +3 -1
- package/build/uploadInput/uploadButton/UploadButton.messages.js.map +1 -1
- package/build/uploadInput/uploadButton/getAllowedFileTypes.js +3 -1
- package/build/uploadInput/uploadButton/getAllowedFileTypes.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +12 -12
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.messages.js +3 -1
- package/build/uploadInput/uploadItem/UploadItem.messages.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js +19 -17
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withId/withId.js +3 -1
- package/build/withId/withId.js.map +1 -1
- package/build/withNextPortal/withNextPortal.js +3 -1
- package/build/withNextPortal/withNextPortal.js.map +1 -1
- package/package.json +10 -11
- package/src/badge/Badge.tsx +1 -1
- package/src/badge/BadgeAssets.tsx +2 -2
- package/src/button/Button.css +2 -2
- package/src/button/Button.less +2 -2
- package/src/common/Option/Option.css +1 -1
- package/src/common/Option/Option.less +2 -2
- package/src/common/Option/Option.tsx +1 -1
- package/src/common/locale/index.ts +1 -1
- package/src/dateInput/DateInput.tsx +7 -1
- package/src/dateLookup/DateLookup.css +0 -5
- package/src/dateLookup/DateLookup.less +0 -4
- package/src/dateLookup/dateHeader/DateHeader.tsx +24 -26
- package/src/divider/Divider.accessibility.docs.mdx +61 -0
- package/src/divider/Divider.css +24 -0
- package/src/divider/Divider.less +31 -0
- package/src/divider/Divider.spec.tsx +60 -0
- package/src/divider/Divider.story.tsx +130 -0
- package/src/divider/Divider.tsx +54 -0
- package/src/divider/index.ts +2 -0
- package/src/i18n/cs.json +22 -5
- package/src/i18n/nl.json +73 -0
- package/src/index.ts +2 -0
- package/src/main.css +27 -8
- package/src/main.less +1 -0
- package/src/upload/Upload.spec.tsx +293 -0
- package/src/upload/Upload.tsx +5 -1
- package/src/upload/steps/completeStep/completeStep.spec.tsx +51 -0
- package/src/upload/steps/completeStep/completeStep.tsx +1 -1
- package/src/upload/steps/processingStep/processingStep.spec.tsx +59 -0
- package/src/upload/steps/uploadImageStep/uploadImageStep.spec.tsx +79 -0
- package/src/upload/Upload.events.spec.js +0 -49
- package/src/upload/Upload.spec.js +0 -305
- package/src/upload/steps/completeStep/completeStep.spec.js +0 -51
- package/src/upload/steps/processingStep/processingStep.spec.js +0 -55
- package/src/upload/steps/uploadImageStep/uploadImageStep.spec.js +0 -91
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import { shallow, mount } from 'enzyme';
|
|
2
|
-
import { act } from 'react';
|
|
3
|
-
import { mockMatchMedia } from '../test-utils';
|
|
4
|
-
|
|
5
|
-
import { ANIMATION_DURATION_IN_MS } from '../processIndicator';
|
|
6
|
-
|
|
7
|
-
import { CompleteStep, UploadImageStep, ProcessingStep } from './steps';
|
|
8
|
-
|
|
9
|
-
import Upload from '.';
|
|
10
|
-
import { Cross } from '@transferwise/icons';
|
|
11
|
-
|
|
12
|
-
mockMatchMedia();
|
|
13
|
-
|
|
14
|
-
jest.mock('./utils/postData', () => ({
|
|
15
|
-
postData: async () => 'ServerResponse',
|
|
16
|
-
}));
|
|
17
|
-
|
|
18
|
-
jest.mock('./utils/asyncFileRead');
|
|
19
|
-
const { asyncFileRead } = require('./utils/asyncFileRead');
|
|
20
|
-
|
|
21
|
-
const defaultLocale = 'en-GB';
|
|
22
|
-
const formatMessage = (id) => String(id);
|
|
23
|
-
jest.mock('react-intl', () => ({
|
|
24
|
-
injectIntl: (Component) =>
|
|
25
|
-
function (props) {
|
|
26
|
-
return (
|
|
27
|
-
<Component {...props} intl={{ locale: defaultLocale, formatMessage: (id) => String(id) }} />
|
|
28
|
-
);
|
|
29
|
-
},
|
|
30
|
-
useIntl: () => ({ formatMessage }),
|
|
31
|
-
defineMessages: (translations) => translations,
|
|
32
|
-
}));
|
|
33
|
-
|
|
34
|
-
const TEST_FILE = new File(['(⌐□_□)'], 'chucknorris.png', { type: 'image/png' });
|
|
35
|
-
const ANIMATION_DELAY = ANIMATION_DURATION_IN_MS * 2;
|
|
36
|
-
|
|
37
|
-
const props = {
|
|
38
|
-
animationDelay: 1000,
|
|
39
|
-
csButtonText: 'csButtonText',
|
|
40
|
-
csFailureText: 'csFailureText',
|
|
41
|
-
csSuccessText: 'csSuccessText',
|
|
42
|
-
csTooLargeMessage: 'csTooLargeMessage',
|
|
43
|
-
maxSize: 5000000,
|
|
44
|
-
onCancel: jest.fn(),
|
|
45
|
-
onChange: jest.fn(),
|
|
46
|
-
onFailure: jest.fn(),
|
|
47
|
-
onStart: jest.fn(),
|
|
48
|
-
onSuccess: jest.fn(),
|
|
49
|
-
psButtonText: 'psButtonText',
|
|
50
|
-
psProcessingText: 'psProcessingText',
|
|
51
|
-
usAccept: 'image/*',
|
|
52
|
-
usButtonText: 'Or Select File',
|
|
53
|
-
usButtonRetryText: 'Try again',
|
|
54
|
-
usDropMessage: 'Drop file to start upload',
|
|
55
|
-
usPlaceholder: 'Drag and drop a file less than 5MB',
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const UPLOADIMAGE_STEP_PROPS = {
|
|
59
|
-
fileDropped: expect.any(Function),
|
|
60
|
-
isComplete: false,
|
|
61
|
-
usAccept: props.usAccept,
|
|
62
|
-
usButtonText: props.usButtonText,
|
|
63
|
-
usDisabled: false,
|
|
64
|
-
usHelpImage: undefined,
|
|
65
|
-
usLabel: '',
|
|
66
|
-
usPlaceholder: props.usPlaceholder,
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const PROCESSING_STEP_PROPS = {
|
|
70
|
-
isComplete: false,
|
|
71
|
-
isError: false,
|
|
72
|
-
isSuccess: false,
|
|
73
|
-
onAnimationCompleted: expect.any(Function),
|
|
74
|
-
onClear: expect.any(Function),
|
|
75
|
-
psButtonText: props.psButtonText,
|
|
76
|
-
psProcessingText: props.psProcessingText,
|
|
77
|
-
psButtonDisabled: false,
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const COMPLETED_STEP_PROPS = {
|
|
81
|
-
csButtonText: props.csButtonText,
|
|
82
|
-
csFailureText: props.csFailureText,
|
|
83
|
-
csSuccessText: props.csSuccessText,
|
|
84
|
-
fileName: TEST_FILE.name,
|
|
85
|
-
isComplete: true,
|
|
86
|
-
isError: false,
|
|
87
|
-
isImage: true,
|
|
88
|
-
onClear: expect.any(Function),
|
|
89
|
-
uploadedImage: 'data:image/png;base64,KOKMkOKWoV/ilqEp',
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
describe('Upload', () => {
|
|
93
|
-
let component;
|
|
94
|
-
beforeEach(() => {
|
|
95
|
-
jest.useFakeTimers();
|
|
96
|
-
component = shallow(<Upload {...props} />).dive();
|
|
97
|
-
asyncFileRead.mockImplementation(async () => 'a value');
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
afterEach(async () => {
|
|
101
|
-
await jest.runOnlyPendingTimersAsync();
|
|
102
|
-
jest.useRealTimers();
|
|
103
|
-
jest.clearAllMocks();
|
|
104
|
-
jest.clearAllTimers();
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it('renders container', () => {
|
|
108
|
-
expect(component.find('.droppable-md')).toHaveLength(1);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it('renders the UploadImageStep by default', () => {
|
|
112
|
-
expect(component.find(UploadImageStep)).toHaveLength(1);
|
|
113
|
-
expect(component.find(ProcessingStep)).toHaveLength(0);
|
|
114
|
-
expect(component.find(CompleteStep)).toHaveLength(0);
|
|
115
|
-
expect(component.find('.droppable-dropping-card')).toHaveLength(1);
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
it('renders the ProcessingStep when state is processing', () => {
|
|
119
|
-
component.setState({ isProcessing: true });
|
|
120
|
-
|
|
121
|
-
expect(component.find(UploadImageStep)).toHaveLength(0);
|
|
122
|
-
expect(component.find(ProcessingStep)).toHaveLength(1);
|
|
123
|
-
expect(component.find(CompleteStep)).toHaveLength(0);
|
|
124
|
-
expect(component.find('.droppable-dropping-card')).toHaveLength(0);
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
it('renders the CompleteStep when state is completed', () => {
|
|
128
|
-
component.setState({ isComplete: true });
|
|
129
|
-
|
|
130
|
-
expect(component.find(UploadImageStep)).toHaveLength(0);
|
|
131
|
-
expect(component.find(ProcessingStep)).toHaveLength(0);
|
|
132
|
-
expect(component.find(CompleteStep)).toHaveLength(1);
|
|
133
|
-
expect(component.find('.droppable-dropping-card')).toHaveLength(1);
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
describe('before file is dropped', () => {
|
|
137
|
-
it('renders the UploadImageStep with right props', () => {
|
|
138
|
-
expect(component.find(UploadImageStep).props()).toStrictEqual(UPLOADIMAGE_STEP_PROPS);
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
describe('when file is dropped', () => {
|
|
143
|
-
it('onStart is called with file', async () => {
|
|
144
|
-
await component.instance().fileDropped(TEST_FILE);
|
|
145
|
-
|
|
146
|
-
expect(props.onStart).toHaveBeenCalledWith(TEST_FILE);
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
it('step changes from UploadImageStep to ProcessingStep', async () => {
|
|
150
|
-
expect(component.find(UploadImageStep)).toHaveLength(1);
|
|
151
|
-
expect(component.find(ProcessingStep)).toHaveLength(0);
|
|
152
|
-
expect(component.find(CompleteStep)).toHaveLength(0);
|
|
153
|
-
|
|
154
|
-
await component.instance().fileDropped(TEST_FILE);
|
|
155
|
-
component.update();
|
|
156
|
-
|
|
157
|
-
expect(component.find(UploadImageStep)).toHaveLength(0);
|
|
158
|
-
expect(component.find(ProcessingStep)).toHaveLength(1);
|
|
159
|
-
expect(component.find(CompleteStep)).toHaveLength(0);
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
it('step changes from UploadImageStep to ProcessingStep with right props', async () => {
|
|
163
|
-
await component.instance().fileDropped(TEST_FILE);
|
|
164
|
-
component.update();
|
|
165
|
-
|
|
166
|
-
expect(component.find(ProcessingStep).props()).toStrictEqual(PROCESSING_STEP_PROPS);
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
describe('when file is being processed', () => {
|
|
171
|
-
it('step ProcessingStep is called with success props', async () => {
|
|
172
|
-
await component.instance().fileDropped(TEST_FILE);
|
|
173
|
-
jest.advanceTimersByTime(props.animationDelay);
|
|
174
|
-
component.update();
|
|
175
|
-
|
|
176
|
-
expect(component.find(ProcessingStep).props()).toStrictEqual({
|
|
177
|
-
...PROCESSING_STEP_PROPS,
|
|
178
|
-
isSuccess: true,
|
|
179
|
-
});
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
it('step ProcessingStep is called with error props', async () => {
|
|
183
|
-
asyncFileRead.mockImplementation(async () => {
|
|
184
|
-
throw 'An error';
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
await component.instance().fileDropped(TEST_FILE);
|
|
188
|
-
jest.advanceTimersByTime(props.animationDelay);
|
|
189
|
-
component.update();
|
|
190
|
-
|
|
191
|
-
expect(component.find(ProcessingStep).props()).toStrictEqual({
|
|
192
|
-
...PROCESSING_STEP_PROPS,
|
|
193
|
-
isError: true,
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
it('should disable processing button when psButtonDisabled is true', async () => {
|
|
198
|
-
component.setProps({ psButtonDisabled: true });
|
|
199
|
-
await component.instance().fileDropped(TEST_FILE);
|
|
200
|
-
jest.advanceTimersByTime(props.animationDelay);
|
|
201
|
-
component.update();
|
|
202
|
-
|
|
203
|
-
expect(component.find(ProcessingStep).props()).toStrictEqual({
|
|
204
|
-
...PROCESSING_STEP_PROPS,
|
|
205
|
-
psButtonDisabled: true,
|
|
206
|
-
isError: false,
|
|
207
|
-
isSuccess: true,
|
|
208
|
-
});
|
|
209
|
-
});
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
describe('when file is processed', () => {
|
|
213
|
-
const waitForUpload = async () => {
|
|
214
|
-
for (let i = 0; i < 4; i += 1) {
|
|
215
|
-
await act(async () => {
|
|
216
|
-
await jest.runOnlyPendingTimersAsync();
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
it('step changes from UploadImageStep to CompleteStep', async () => {
|
|
222
|
-
component = mount(<Upload {...props} />);
|
|
223
|
-
const upload = component.children();
|
|
224
|
-
expect(upload.find(UploadImageStep)).toHaveLength(1);
|
|
225
|
-
expect(upload.find(ProcessingStep)).toHaveLength(0);
|
|
226
|
-
expect(upload.find(CompleteStep)).toHaveLength(0);
|
|
227
|
-
|
|
228
|
-
await act(async () => {
|
|
229
|
-
await upload.instance().fileDropped(TEST_FILE);
|
|
230
|
-
});
|
|
231
|
-
await waitForUpload();
|
|
232
|
-
component.update();
|
|
233
|
-
|
|
234
|
-
expect(component.find(UploadImageStep)).toHaveLength(0);
|
|
235
|
-
expect(component.find(ProcessingStep)).toHaveLength(0);
|
|
236
|
-
expect(component.find(CompleteStep)).toHaveLength(1);
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
it('step UploadImageStep is called with error props', async () => {
|
|
240
|
-
component = mount(<Upload {...props} />);
|
|
241
|
-
const upload = component.children();
|
|
242
|
-
asyncFileRead.mockImplementation(async () => {
|
|
243
|
-
throw 'An error';
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
await act(async () => {
|
|
247
|
-
await upload.instance().fileDropped(TEST_FILE);
|
|
248
|
-
});
|
|
249
|
-
await waitForUpload();
|
|
250
|
-
component.update();
|
|
251
|
-
|
|
252
|
-
expect(component.find(UploadImageStep).props()).toStrictEqual({
|
|
253
|
-
...UPLOADIMAGE_STEP_PROPS,
|
|
254
|
-
isComplete: false,
|
|
255
|
-
errorMessage: 'csFailureText',
|
|
256
|
-
errorIconLabel: undefined,
|
|
257
|
-
usButtonText: 'Try again',
|
|
258
|
-
usHelpImage: null,
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
it('onSuccess is called with response when httpOptions are provided', async () => {
|
|
263
|
-
component = mount(<Upload {...props} httpOptions={{ url: 'a-url' }} />).children();
|
|
264
|
-
|
|
265
|
-
await act(async () => {
|
|
266
|
-
await component.instance().fileDropped(TEST_FILE);
|
|
267
|
-
});
|
|
268
|
-
await waitForUpload();
|
|
269
|
-
|
|
270
|
-
expect(props.onSuccess).toHaveBeenCalledWith('ServerResponse', TEST_FILE.name);
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
it('wont process new file while current process is in progress', async () => {
|
|
274
|
-
component = mount(<Upload {...props} httpOptions={{ url: 'a-url' }} />).children();
|
|
275
|
-
|
|
276
|
-
await act(async () => {
|
|
277
|
-
await component.instance().fileDropped(TEST_FILE);
|
|
278
|
-
});
|
|
279
|
-
const result = await act(async () => component.instance().fileDropped(TEST_FILE));
|
|
280
|
-
|
|
281
|
-
expect(result).toBe(false);
|
|
282
|
-
|
|
283
|
-
await waitForUpload();
|
|
284
|
-
|
|
285
|
-
expect(props.onSuccess).toHaveBeenCalledTimes(1);
|
|
286
|
-
});
|
|
287
|
-
|
|
288
|
-
it('should respect `errorIconLabel` override', async () => {
|
|
289
|
-
const errorIconLabel = 'Custom error icon label';
|
|
290
|
-
component = mount(<Upload {...props} errorIconLabel={errorIconLabel} />);
|
|
291
|
-
const upload = component.children();
|
|
292
|
-
asyncFileRead.mockImplementation(async () => {
|
|
293
|
-
throw 'An error';
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
await act(async () => {
|
|
297
|
-
await upload.instance().fileDropped(TEST_FILE);
|
|
298
|
-
});
|
|
299
|
-
await waitForUpload();
|
|
300
|
-
component.update();
|
|
301
|
-
|
|
302
|
-
expect(component.find(Cross).at(1).prop('title')).toBe(errorIconLabel);
|
|
303
|
-
});
|
|
304
|
-
});
|
|
305
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Document as DocumentIcon } from '@transferwise/icons';
|
|
2
|
-
import { shallow } from 'enzyme';
|
|
3
|
-
|
|
4
|
-
import Body from '../../../body';
|
|
5
|
-
import Button from '../../../button';
|
|
6
|
-
|
|
7
|
-
import CompleteStep from '.';
|
|
8
|
-
|
|
9
|
-
describe('CompleteStep', () => {
|
|
10
|
-
const COMPLETED_STEP_PROPS = {
|
|
11
|
-
isComplete: true,
|
|
12
|
-
uploadedImage: '',
|
|
13
|
-
fileName: 'fileName',
|
|
14
|
-
isError: false,
|
|
15
|
-
isImage: true,
|
|
16
|
-
csSuccessText: 'csSuccessText',
|
|
17
|
-
csFailureText: 'csFailureText',
|
|
18
|
-
csButtonText: 'csButtonText',
|
|
19
|
-
onClear: jest.fn(),
|
|
20
|
-
usLabel: 'usLabel',
|
|
21
|
-
};
|
|
22
|
-
let component;
|
|
23
|
-
beforeEach(() => {
|
|
24
|
-
component = shallow(<CompleteStep {...COMPLETED_STEP_PROPS} />);
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('renders container', () => {
|
|
28
|
-
expect(component.find('.droppable-complete-card')).toHaveLength(1);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
describe('when error is false', () => {
|
|
32
|
-
it('renders isImage or Upload icon', () => {
|
|
33
|
-
expect(component.find(DocumentIcon)).toHaveLength(1);
|
|
34
|
-
component.setProps({ uploadedImage: 'uploadedImage' });
|
|
35
|
-
expect(component.find('img.thumbnail')).toHaveLength(1);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('renders filename when error is false', () => {
|
|
39
|
-
expect(component.find(Body).props().children).toBe(COMPLETED_STEP_PROPS.fileName);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('renders button when csButtonText is set up', () => {
|
|
44
|
-
expect(component.find(Button)).toHaveLength(1);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('calls onClear when button is clicked', () => {
|
|
48
|
-
component.find(Button).simulate('click', {});
|
|
49
|
-
expect(COMPLETED_STEP_PROPS.onClear).toHaveBeenCalledTimes(1);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { shallow } from 'enzyme';
|
|
2
|
-
|
|
3
|
-
import Button from '../../../button';
|
|
4
|
-
import ProcessIndicator from '../../../processIndicator';
|
|
5
|
-
import Title from '../../../title/Title';
|
|
6
|
-
|
|
7
|
-
import ProcessingStep from '.';
|
|
8
|
-
|
|
9
|
-
describe('ProcessingStep', () => {
|
|
10
|
-
const PROCESSING_STEP_PROPS = {
|
|
11
|
-
isComplete: false,
|
|
12
|
-
isError: false,
|
|
13
|
-
isSuccess: false,
|
|
14
|
-
onAnimationCompleted: jest.fn(),
|
|
15
|
-
onClear: jest.fn(),
|
|
16
|
-
psButtonText: 'psButtonText',
|
|
17
|
-
psProcessingText: 'psProcessingText',
|
|
18
|
-
};
|
|
19
|
-
let component;
|
|
20
|
-
beforeEach(() => {
|
|
21
|
-
component = shallow(<ProcessingStep {...PROCESSING_STEP_PROPS} />);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('renders container', () => {
|
|
25
|
-
expect(component.find('.droppable-processing-card')).toHaveLength(1);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('renders ProcessIndicator with default status', () => {
|
|
29
|
-
expect(component.find(ProcessIndicator)).toHaveLength(1);
|
|
30
|
-
expect(component.find(ProcessIndicator).props().status).toBe('processing');
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('renders ProcessIndicator with success status', () => {
|
|
34
|
-
component = shallow(<ProcessingStep {...PROCESSING_STEP_PROPS} isSuccess />);
|
|
35
|
-
expect(component.find(ProcessIndicator).props().status).toBe('succeeded');
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('renders ProcessIndicator with error status', () => {
|
|
39
|
-
component = shallow(<ProcessingStep {...PROCESSING_STEP_PROPS} isError />);
|
|
40
|
-
expect(component.find(ProcessIndicator).props().status).toBe('failed');
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('renders psProcessingText', () => {
|
|
44
|
-
expect(component.find(Title).props().children).toBe(PROCESSING_STEP_PROPS.psProcessingText);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('renders button when psButtonText is set up', () => {
|
|
48
|
-
expect(component.find(Button)).toHaveLength(1);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('calls onClear when button is clicked', () => {
|
|
52
|
-
component.find(Button).simulate('click', {});
|
|
53
|
-
expect(PROCESSING_STEP_PROPS.onClear).toHaveBeenCalledTimes(1);
|
|
54
|
-
});
|
|
55
|
-
});
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { Upload as UploadIcon } from '@transferwise/icons';
|
|
2
|
-
import { shallow } from 'enzyme';
|
|
3
|
-
import StatusIcon from '../../../statusIcon/StatusIcon';
|
|
4
|
-
|
|
5
|
-
import UploadImageStep from '.';
|
|
6
|
-
import { InlineAlert } from '../../../index';
|
|
7
|
-
|
|
8
|
-
describe('uploadImageStep', () => {
|
|
9
|
-
const UPLOADIMAGE_STEP_PROPS = {
|
|
10
|
-
fileDropped: jest.fn(),
|
|
11
|
-
isComplete: false,
|
|
12
|
-
usAccept: 'usAccept',
|
|
13
|
-
usButtonText: '',
|
|
14
|
-
usDisabled: false,
|
|
15
|
-
usLabel: '',
|
|
16
|
-
usHelpImage: '',
|
|
17
|
-
usPlaceholder: '',
|
|
18
|
-
errorMessage: '',
|
|
19
|
-
};
|
|
20
|
-
let component;
|
|
21
|
-
beforeEach(() => {
|
|
22
|
-
component = shallow(<UploadImageStep {...UPLOADIMAGE_STEP_PROPS} />);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('renders container', () => {
|
|
26
|
-
expect(component.find('.droppable-default-card')).toHaveLength(1);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('renders helpImage or Upload icon', () => {
|
|
30
|
-
expect(component.find(UploadIcon)).toHaveLength(2);
|
|
31
|
-
component.setProps({ usHelpImage: 'usHelpImage' });
|
|
32
|
-
expect(component.find('img.thumbnail')).toHaveLength(1);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('renders label', () => {
|
|
36
|
-
expect(component.find('h4')).toHaveLength(0);
|
|
37
|
-
component.setProps({ usLabel: 'usLabel' });
|
|
38
|
-
expect(component.find('h4').text()).toBe('usLabel');
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('renders placeholder', () => {
|
|
42
|
-
expect(component.find('p')).toHaveLength(0);
|
|
43
|
-
component.setProps({ usPlaceholder: 'usPlaceholder' });
|
|
44
|
-
expect(component.find('p').text()).toBe('usPlaceholder');
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('renders buttonText or Icon', () => {
|
|
48
|
-
expect(component.find('.btn-primary')).toHaveLength(1);
|
|
49
|
-
expect(component.find(UploadIcon)).toHaveLength(2);
|
|
50
|
-
component.setProps({ usButtonText: 'usButtonText' });
|
|
51
|
-
expect(component.find('.btn-primary span').text()).toBe('usButtonText');
|
|
52
|
-
expect(component.find(UploadIcon)).toHaveLength(1);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('renders input file', () => {
|
|
56
|
-
expect(component.find('input[type="file"]')).toHaveLength(1);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('renders a custom usHelpImage file', () => {
|
|
60
|
-
component = shallow(
|
|
61
|
-
<UploadImageStep
|
|
62
|
-
{...UPLOADIMAGE_STEP_PROPS}
|
|
63
|
-
usHelpImage={<img src="https://test.com" alt="test" className="test-image" />}
|
|
64
|
-
/>,
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
expect(component.find('.test-image')).toHaveLength(1);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('should respect `errorIconLabel` override', () => {
|
|
71
|
-
const errorIconLabel = 'Error icon label';
|
|
72
|
-
component = shallow(
|
|
73
|
-
<UploadImageStep
|
|
74
|
-
{...UPLOADIMAGE_STEP_PROPS}
|
|
75
|
-
errorMessage="Maximum filesize is 2MB."
|
|
76
|
-
errorIconLabel={errorIconLabel}
|
|
77
|
-
/>,
|
|
78
|
-
);
|
|
79
|
-
expect(component.find(InlineAlert).prop('iconLabel')).toBe(errorIconLabel);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
describe('when errorMessage is not empty', () => {
|
|
83
|
-
it('renders errorMessage and icon when error is true', () => {
|
|
84
|
-
component = shallow(
|
|
85
|
-
<UploadImageStep {...UPLOADIMAGE_STEP_PROPS} errorMessage="error message" />,
|
|
86
|
-
);
|
|
87
|
-
expect(component.find('.upload-error-message').text()).toBe('<InlineAlert />');
|
|
88
|
-
expect(component.find(StatusIcon)).toHaveLength(1);
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
});
|