@opentrons/components 0.1.6-alpha.17 → 0.1.6-alpha.19
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/package.json +2 -2
- package/src/hardware-sim/BaseDeck/something.test.tsx +7 -0
- package/src/hardware-sim/Deck/SlotLabels.tsx +1 -1
- package/src/hardware-sim/ProtocolDeck/LabwareInfo.tsx +1 -1
- package/src/hardware-sim/ProtocolDeck/index.tsx +2 -2
- package/src/index.ts +2 -41
- package/src/molecules/DeckInfoLabel/index.tsx +1 -1
- package/src/molecules/DeckLabel/index.tsx +3 -3
- package/lib/__tests__/utils.test.d.ts +0 -1
- package/lib/alerts/AlertItem.d.ts +0 -21
- package/lib/alerts/index.d.ts +0 -1
- package/lib/atoms/Checkbox/__tests__/Checkbox.test.d.ts +0 -1
- package/lib/atoms/Checkbox/index.d.ts +0 -25
- package/lib/atoms/CheckboxField/__tests__/CheckboxField.test.d.ts +0 -1
- package/lib/atoms/CheckboxField/index.d.ts +0 -20
- package/lib/atoms/Chip/__tests__/Chip.test.d.ts +0 -1
- package/lib/atoms/Chip/index.d.ts +0 -20
- package/lib/atoms/Divider/index.d.ts +0 -5
- package/lib/atoms/InputField/__tests__/InputField.test.d.ts +0 -1
- package/lib/atoms/InputField/index.d.ts +0 -68
- package/lib/atoms/ListButton/ListButtonChildren/ListButtonAccordion.d.ts +0 -10
- package/lib/atoms/ListButton/ListButtonChildren/ListButtonAccordionContainer.d.ts +0 -7
- package/lib/atoms/ListButton/ListButtonChildren/ListButtonRadioButton.d.ts +0 -14
- package/lib/atoms/ListButton/ListButtonChildren/index.d.ts +0 -3
- package/lib/atoms/ListButton/__tests__/ListButton.test.d.ts +0 -1
- package/lib/atoms/ListButton/__tests__/ListButtonAccordion.test.d.ts +0 -1
- package/lib/atoms/ListButton/__tests__/ListButtonRadioButton.test.d.ts +0 -1
- package/lib/atoms/ListButton/index.d.ts +0 -11
- package/lib/atoms/ListItem/ListItemChildren/ListItemCustomize.d.ts +0 -15
- package/lib/atoms/ListItem/ListItemChildren/ListItemDescriptor.d.ts +0 -8
- package/lib/atoms/ListItem/ListItemChildren/index.d.ts +0 -2
- package/lib/atoms/ListItem/__tests__/ListItem.test.d.ts +0 -1
- package/lib/atoms/ListItem/index.d.ts +0 -14
- package/lib/atoms/MenuList/MenuItem.d.ts +0 -7
- package/lib/atoms/MenuList/OverflowBtn.d.ts +0 -7
- package/lib/atoms/MenuList/__tests__/MenuItem.test.d.ts +0 -1
- package/lib/atoms/MenuList/__tests__/MenuList.test.d.ts +0 -1
- package/lib/atoms/MenuList/__tests__/OverflowBtn.test.d.ts +0 -1
- package/lib/atoms/MenuList/index.d.ts +0 -8
- package/lib/atoms/Snackbar/__tests__/Snackbar.test.d.ts +0 -1
- package/lib/atoms/Snackbar/index.d.ts +0 -7
- package/lib/atoms/StepMeter/index.d.ts +0 -7
- package/lib/atoms/StyledText/LegacyStyledText.d.ts +0 -6
- package/lib/atoms/StyledText/StyledText.d.ts +0 -154
- package/lib/atoms/StyledText/index.d.ts +0 -2
- package/lib/atoms/Tag/__tests__/Tag.test.d.ts +0 -1
- package/lib/atoms/Tag/index.d.ts +0 -14
- package/lib/atoms/Toast/__tests__/ODDToast.test.d.ts +0 -1
- package/lib/atoms/Toast/__tests__/Toast.test.d.ts +0 -1
- package/lib/atoms/Toast/index.d.ts +0 -25
- package/lib/atoms/ToggleGroup/__tests__/ToggleGroup.test.d.ts +0 -1
- package/lib/atoms/ToggleGroup/index.d.ts +0 -9
- package/lib/atoms/Tooltip/__tests__/Tooltip.test.d.ts +0 -1
- package/lib/atoms/Tooltip/index.d.ts +0 -11
- package/lib/atoms/buttons/AlertPrimaryButton.d.ts +0 -1
- package/lib/atoms/buttons/AltPrimaryButton.d.ts +0 -1
- package/lib/atoms/buttons/EmptySelectorButton.d.ts +0 -10
- package/lib/atoms/buttons/LargeButton.d.ts +0 -17
- package/lib/atoms/buttons/PrimaryButton.d.ts +0 -1
- package/lib/atoms/buttons/RadioButton.d.ts +0 -21
- package/lib/atoms/buttons/SecondaryButton.d.ts +0 -7
- package/lib/atoms/buttons/__tests__/AlertPrimaryButton.test.d.ts +0 -1
- package/lib/atoms/buttons/__tests__/AltPrimaryButton.test.d.ts +0 -1
- package/lib/atoms/buttons/__tests__/EmptySelectorButton.test.d.ts +0 -1
- package/lib/atoms/buttons/__tests__/LargeButton.test.d.ts +0 -1
- package/lib/atoms/buttons/__tests__/PrimaryButton.test.d.ts +0 -1
- package/lib/atoms/buttons/__tests__/RadioButton.test.d.ts +0 -1
- package/lib/atoms/buttons/__tests__/SecondaryButton.test.d.ts +0 -1
- package/lib/atoms/buttons/index.d.ts +0 -6
- package/lib/atoms/index.d.ts +0 -20
- package/lib/barrel.d.ts +0 -3
- package/lib/buttons/Button.d.ts +0 -50
- package/lib/buttons/DeprecatedPrimaryButton.d.ts +0 -8
- package/lib/buttons/FlatButton.d.ts +0 -5
- package/lib/buttons/IconButton.d.ts +0 -14
- package/lib/buttons/OutlineButton.d.ts +0 -8
- package/lib/buttons/index.d.ts +0 -5
- package/lib/controls/ControlInfo.d.ts +0 -6
- package/lib/controls/LabeledButton.d.ts +0 -8
- package/lib/controls/LabeledCheckbox.d.ts +0 -10
- package/lib/controls/LabeledControl.d.ts +0 -7
- package/lib/controls/LabeledRadioGroup.d.ts +0 -8
- package/lib/controls/LabeledSelect.d.ts +0 -9
- package/lib/controls/LabeledToggle.d.ts +0 -11
- package/lib/controls/StackedLabeledControl.d.ts +0 -7
- package/lib/controls/ToggleButton.d.ts +0 -5
- package/lib/controls/index.d.ts +0 -6
- package/lib/forms/DeprecatedCheckboxField.d.ts +0 -33
- package/lib/forms/DropdownField.d.ts +0 -38
- package/lib/forms/FormGroup.d.ts +0 -19
- package/lib/forms/LegacyInputField.d.ts +0 -51
- package/lib/forms/RadioGroup.d.ts +0 -29
- package/lib/forms/Select.d.ts +0 -26
- package/lib/forms/SelectField.d.ts +0 -33
- package/lib/forms/ToggleField.d.ts +0 -22
- package/lib/forms/__tests__/DeprecatedCheckboxField.test.d.ts +0 -1
- package/lib/forms/__tests__/DropdownField.test.d.ts +0 -1
- package/lib/forms/__tests__/InputField.test.d.ts +0 -1
- package/lib/forms/__tests__/Select.test.d.ts +0 -1
- package/lib/forms/__tests__/SelectField.test.d.ts +0 -1
- package/lib/forms/__tests__/ToggleField.test.d.ts +0 -1
- package/lib/forms/index.d.ts +0 -8
- package/lib/hardware-sim/BaseDeck/BaseDeck.d.ts +0 -49
- package/lib/hardware-sim/BaseDeck/SingleSlotFixture.d.ts +0 -12
- package/lib/hardware-sim/BaseDeck/SlotBase.d.ts +0 -2
- package/lib/hardware-sim/BaseDeck/SlotClip.d.ts +0 -2
- package/lib/hardware-sim/BaseDeck/StagingAreaFixture.d.ts +0 -13
- package/lib/hardware-sim/BaseDeck/WasteChuteFixture.d.ts +0 -20
- package/lib/hardware-sim/BaseDeck/WasteChuteStagingAreaFixture.d.ts +0 -14
- package/lib/hardware-sim/BaseDeck/__fixtures__/index.d.ts +0 -4
- package/lib/hardware-sim/BaseDeck/index.d.ts +0 -5
- package/lib/hardware-sim/Deck/DeckFromLayers.d.ts +0 -10
- package/lib/hardware-sim/Deck/FlexTrash.d.ts +0 -14
- package/lib/hardware-sim/Deck/MoveLabwareOnDeck.d.ts +0 -16
- package/lib/hardware-sim/Deck/OT2Layers.d.ts +0 -10
- package/lib/hardware-sim/Deck/RobotCoordsForeignDiv.d.ts +0 -14
- package/lib/hardware-sim/Deck/RobotCoordsForeignObject.d.ts +0 -12
- package/lib/hardware-sim/Deck/RobotCoordsText.d.ts +0 -9
- package/lib/hardware-sim/Deck/RobotWorkSpace.d.ts +0 -21
- package/lib/hardware-sim/Deck/SlotLabels.d.ts +0 -12
- package/lib/hardware-sim/Deck/__mocks__/getDeckDefinitions.d.ts +0 -1
- package/lib/hardware-sim/Deck/constants.d.ts +0 -1
- package/lib/hardware-sim/Deck/index.d.ts +0 -8
- package/lib/hardware-sim/DeckConfigurator/AbsorbanceReaderFixture.d.ts +0 -10
- package/lib/hardware-sim/DeckConfigurator/EmptyConfigFixture.d.ts +0 -8
- package/lib/hardware-sim/DeckConfigurator/HeaterShakerFixture.d.ts +0 -10
- package/lib/hardware-sim/DeckConfigurator/MagneticBlockFixture.d.ts +0 -11
- package/lib/hardware-sim/DeckConfigurator/StagingAreaConfigFixture.d.ts +0 -10
- package/lib/hardware-sim/DeckConfigurator/StaticFixture.d.ts +0 -12
- package/lib/hardware-sim/DeckConfigurator/TemperatureModuleFixture.d.ts +0 -10
- package/lib/hardware-sim/DeckConfigurator/ThermocyclerFixture.d.ts +0 -10
- package/lib/hardware-sim/DeckConfigurator/TrashBinConfigFixture.d.ts +0 -10
- package/lib/hardware-sim/DeckConfigurator/WasteChuteConfigFixture.d.ts +0 -11
- package/lib/hardware-sim/DeckConfigurator/constants.d.ts +0 -20
- package/lib/hardware-sim/DeckConfigurator/index.d.ts +0 -20
- package/lib/hardware-sim/DeckSlotLocation/index.d.ts +0 -15
- package/lib/hardware-sim/Labware/Labware.d.ts +0 -39
- package/lib/hardware-sim/Labware/LabwareAdapter/Opentrons96DeepWellAdapter.d.ts +0 -1
- package/lib/hardware-sim/Labware/LabwareAdapter/Opentrons96FlatBottomAdapter.d.ts +0 -1
- package/lib/hardware-sim/Labware/LabwareAdapter/OpentronsAluminumFlatBottomPlate.d.ts +0 -1
- package/lib/hardware-sim/Labware/LabwareAdapter/OpentronsAutoclavableDeckRiser.d.ts +0 -1
- package/lib/hardware-sim/Labware/LabwareAdapter/OpentronsFlex96TiprackAdapter.d.ts +0 -1
- package/lib/hardware-sim/Labware/LabwareAdapter/OpentronsToughPCRAutoSealingLid.d.ts +0 -1
- package/lib/hardware-sim/Labware/LabwareAdapter/OpentronsUniversalFlatAdapter.d.ts +0 -1
- package/lib/hardware-sim/Labware/LabwareAdapter/index.d.ts +0 -27
- package/lib/hardware-sim/Labware/LabwareRender.d.ts +0 -46
- package/lib/hardware-sim/Labware/LabwareStackRender.d.ts +0 -20
- package/lib/hardware-sim/Labware/__tests__/Labware.test.d.ts +0 -1
- package/lib/hardware-sim/Labware/__tests__/LabwareRender.test.d.ts +0 -1
- package/lib/hardware-sim/Labware/index.d.ts +0 -5
- package/lib/hardware-sim/Labware/labwareInternals/FilledWells.d.ts +0 -11
- package/lib/hardware-sim/Labware/labwareInternals/LabwareOutline.d.ts +0 -21
- package/lib/hardware-sim/Labware/labwareInternals/LabwareWellLabels.d.ts +0 -15
- package/lib/hardware-sim/Labware/labwareInternals/StaticLabware.d.ts +0 -25
- package/lib/hardware-sim/Labware/labwareInternals/StrokedWells.d.ts +0 -9
- package/lib/hardware-sim/Labware/labwareInternals/StyledWells.d.ts +0 -19
- package/lib/hardware-sim/Labware/labwareInternals/Well.d.ts +0 -20
- package/lib/hardware-sim/Labware/labwareInternals/WellLabels.d.ts +0 -12
- package/lib/hardware-sim/Labware/labwareInternals/__tests__/LabwareWellLabels.test.d.ts +0 -1
- package/lib/hardware-sim/Labware/labwareInternals/__tests__/StrokedWells.test.d.ts +0 -1
- package/lib/hardware-sim/Labware/labwareInternals/__tests__/WellLabels.test.d.ts +0 -1
- package/lib/hardware-sim/Labware/labwareInternals/index.d.ts +0 -8
- package/lib/hardware-sim/Labware/labwareInternals/types.d.ts +0 -12
- package/lib/hardware-sim/Module/HeaterShaker.d.ts +0 -4
- package/lib/hardware-sim/Module/MagneticBlock.d.ts +0 -1
- package/lib/hardware-sim/Module/MagneticModule.d.ts +0 -1
- package/lib/hardware-sim/Module/ModuleTag.d.ts +0 -9
- package/lib/hardware-sim/Module/PlateReader.d.ts +0 -1
- package/lib/hardware-sim/Module/Temperature.d.ts +0 -4
- package/lib/hardware-sim/Module/Thermocycler/ThermocyclerGEN1.d.ts +0 -6
- package/lib/hardware-sim/Module/Thermocycler/ThermocyclerGEN2.d.ts +0 -6
- package/lib/hardware-sim/Module/Thermocycler/index.d.ts +0 -7
- package/lib/hardware-sim/Module/index.d.ts +0 -18
- package/lib/hardware-sim/Pipette/EightEmanatingNozzles.d.ts +0 -4
- package/lib/hardware-sim/Pipette/EmanatingNozzle.d.ts +0 -4
- package/lib/hardware-sim/Pipette/PipetteRender.d.ts +0 -8
- package/lib/hardware-sim/Pipette/__tests__/EightEmanatingNozzles.test.d.ts +0 -1
- package/lib/hardware-sim/Pipette/__tests__/EmanatingNozzle.test.d.ts +0 -1
- package/lib/hardware-sim/Pipette/__tests__/PipetteRender.test.d.ts +0 -1
- package/lib/hardware-sim/Pipette/constants.d.ts +0 -7
- package/lib/hardware-sim/Pipette/index.d.ts +0 -1
- package/lib/hardware-sim/ProtocolDeck/LabwareInfo.d.ts +0 -6
- package/lib/hardware-sim/ProtocolDeck/index.d.ts +0 -14
- package/lib/hardware-sim/ProtocolDeck/types.d.ts +0 -8
- package/lib/hardware-sim/ProtocolDeck/utils/__tests__/getLabwareInforByLiquidId.test.d.ts +0 -1
- package/lib/hardware-sim/ProtocolDeck/utils/getInitiallyLoadedLabwareByAdapter.d.ts +0 -5
- package/lib/hardware-sim/ProtocolDeck/utils/getLabwareInSlots.d.ts +0 -12
- package/lib/hardware-sim/ProtocolDeck/utils/getLabwareInfoByLiquidId.d.ts +0 -3
- package/lib/hardware-sim/ProtocolDeck/utils/getModulesInSlots.d.ts +0 -10
- package/lib/hardware-sim/ProtocolDeck/utils/getStandardDeckViewLayerBlockList.d.ts +0 -2
- package/lib/hardware-sim/ProtocolDeck/utils/getWellFillFromLabwareId.d.ts +0 -4
- package/lib/hardware-sim/ProtocolDeck/utils/index.d.ts +0 -3
- package/lib/hardware-sim/RobotCoordinateSpace/RobotCoordinateSpace.d.ts +0 -7
- package/lib/hardware-sim/RobotCoordinateSpace/RobotCoordinateSpaceWithRef.d.ts +0 -16
- package/lib/hardware-sim/RobotCoordinateSpace/index.d.ts +0 -2
- package/lib/hardware-sim/index.d.ts +0 -11
- package/lib/hardware-sim/utils.d.ts +0 -3
- package/lib/helix-design-system/borders.d.ts +0 -26
- package/lib/helix-design-system/colors.d.ts +0 -86
- package/lib/helix-design-system/index.d.ts +0 -4
- package/lib/helix-design-system/product/index.d.ts +0 -1
- package/lib/helix-design-system/product/typography.d.ts +0 -79
- package/lib/helix-design-system/style.d.ts +0 -1
- package/lib/hooks/__tests__/useConditionalConfirm.test.d.ts +0 -1
- package/lib/hooks/__tests__/useDrag.test.d.ts +0 -1
- package/lib/hooks/__tests__/useIdle.test.d.ts +0 -1
- package/lib/hooks/__tests__/useInterval.test.d.ts +0 -1
- package/lib/hooks/__tests__/useLongPress.test.d.ts +0 -1
- package/lib/hooks/__tests__/useMountEffect.test.d.ts +0 -1
- package/lib/hooks/__tests__/usePrevious.test.d.ts +0 -1
- package/lib/hooks/__tests__/useScrolling.test.d.ts +0 -1
- package/lib/hooks/__tests__/useSwipe.test.d.ts +0 -1
- package/lib/hooks/__tests__/useTimeout.test.d.ts +0 -1
- package/lib/hooks/__tests__/useToggle.test.d.ts +0 -1
- package/lib/hooks/index.d.ts +0 -13
- package/lib/hooks/useConditionalConfirm.d.ts +0 -41
- package/lib/hooks/useDrag.d.ts +0 -22
- package/lib/hooks/useIdle.d.ts +0 -11
- package/lib/hooks/useInterval.d.ts +0 -11
- package/lib/hooks/useLongPress.d.ts +0 -19
- package/lib/hooks/useMenuHandleClickOutside.d.ts +0 -9
- package/lib/hooks/useMountEffect.d.ts +0 -8
- package/lib/hooks/usePrevious.d.ts +0 -9
- package/lib/hooks/useScrolling.d.ts +0 -1
- package/lib/hooks/useSelectDeckLocation/index.d.ts +0 -18
- package/lib/hooks/useSwipe.d.ts +0 -12
- package/lib/hooks/useTimeout.d.ts +0 -9
- package/lib/hooks/useToggle.d.ts +0 -22
- package/lib/icons/Icon.d.ts +0 -34
- package/lib/icons/ModuleIcon.d.ts +0 -11
- package/lib/icons/NotificationIcon.d.ts +0 -12
- package/lib/icons/icon-data.d.ts +0 -4
- package/lib/icons/index.d.ts +0 -4
- package/lib/images/index.d.ts +0 -1
- package/lib/images/labware/index.d.ts +0 -1
- package/lib/images/labware/measurement-guide/index.d.ts +0 -13
- package/lib/index.d.ts +0 -26
- package/lib/instrument/InstrumentDiagram.d.ts +0 -11
- package/lib/instrument/InstrumentGroup.d.ts +0 -11
- package/lib/instrument/InstrumentInfo.d.ts +0 -18
- package/lib/instrument/PipetteSelect.d.ts +0 -20
- package/lib/instrument/__tests__/InstrumentInfo.test.d.ts +0 -1
- package/lib/instrument/__tests__/PipetteSelect.test.d.ts +0 -1
- package/lib/instrument/index.d.ts +0 -4
- package/lib/interaction-enhancers/ClickOutside.d.ts +0 -18
- package/lib/interaction-enhancers/HandleKeypress.d.ts +0 -27
- package/lib/interaction-enhancers/__tests__/useHover.test.d.ts +0 -1
- package/lib/interaction-enhancers/index.d.ts +0 -4
- package/lib/interaction-enhancers/useHover.d.ts +0 -33
- package/lib/interaction-enhancers/useOnClickOutside.d.ts +0 -5
- package/lib/legacy-hardware-sim/LabwareNameOverlay.d.ts +0 -7
- package/lib/legacy-hardware-sim/ModuleItem.d.ts +0 -17
- package/lib/legacy-hardware-sim/index.d.ts +0 -2
- package/lib/lists/SidePanelGroup.d.ts +0 -18
- package/lib/lists/TitledList.d.ts +0 -44
- package/lib/lists/index.d.ts +0 -2
- package/lib/modals/AlertModal.d.ts +0 -28
- package/lib/modals/ContinueModal.d.ts +0 -10
- package/lib/modals/LegacyModal.d.ts +0 -24
- package/lib/modals/Modal.d.ts +0 -24
- package/lib/modals/ModalHeader.d.ts +0 -13
- package/lib/modals/ModalShell.d.ts +0 -34
- package/lib/modals/Overlay.d.ts +0 -9
- package/lib/modals/SpinnerModal.d.ts +0 -13
- package/lib/modals/SpinnerModalPage.d.ts +0 -12
- package/lib/modals/__tests__/Modal.test.d.ts +0 -1
- package/lib/modals/__tests__/ModalHeader.test.d.ts +0 -1
- package/lib/modals/__tests__/ModalShell.test.d.ts +0 -1
- package/lib/modals/index.d.ts +0 -9
- package/lib/molecules/Banner/__tests__/Banner.test.d.ts +0 -1
- package/lib/molecules/Banner/index.d.ts +0 -23
- package/lib/molecules/DeckInfoLabel/__tests__/DeckInfoLabel.test.d.ts +0 -1
- package/lib/molecules/DeckInfoLabel/index.d.ts +0 -19
- package/lib/molecules/DeckLabel/__tests__/DeckLabel.test.d.ts +0 -1
- package/lib/molecules/DeckLabel/index.d.ts +0 -10
- package/lib/molecules/DropdownMenu/__tests__/DropdownMenu.test.d.ts +0 -1
- package/lib/molecules/DropdownMenu/index.d.ts +0 -41
- package/lib/molecules/InfoScreen/__tests__/InfoScreen.test.d.ts +0 -1
- package/lib/molecules/InfoScreen/index.d.ts +0 -8
- package/lib/molecules/LiquidIcon/__tests__/LiquidIcon.test.d.ts +0 -1
- package/lib/molecules/LiquidIcon/index.d.ts +0 -9
- package/lib/molecules/ParametersTable/__tests__/ParametersTable.test.d.ts +0 -1
- package/lib/molecules/ParametersTable/index.d.ts +0 -10
- package/lib/molecules/Tabs/__tests__/Tabs.test.d.ts +0 -1
- package/lib/molecules/Tabs/index.d.ts +0 -10
- package/lib/molecules/index.d.ts +0 -8
- package/lib/nav/SidePanel.d.ts +0 -6
- package/lib/nav/index.d.ts +0 -1
- package/lib/organisms/DeckLabelSet/__tests__/DeckLabelSet.test.d.ts +0 -1
- package/lib/organisms/DeckLabelSet/index.d.ts +0 -11
- package/lib/organisms/EndUserAgreementFooter/__tests__/EndUserAgreementFooter.test.d.ts +0 -1
- package/lib/organisms/EndUserAgreementFooter/index.d.ts +0 -1
- package/lib/organisms/Toolbox/__tests__/Toolbox.test.d.ts +0 -1
- package/lib/organisms/Toolbox/index.d.ts +0 -20
- package/lib/organisms/index.d.ts +0 -3
- package/lib/primitives/Box.d.ts +0 -7
- package/lib/primitives/Btn.d.ts +0 -59
- package/lib/primitives/Flex.d.ts +0 -7
- package/lib/primitives/ForeignObject.d.ts +0 -23
- package/lib/primitives/Link.d.ts +0 -11
- package/lib/primitives/Svg.d.ts +0 -23
- package/lib/primitives/Text.d.ts +0 -7
- package/lib/primitives/__tests__/Box.test.d.ts +0 -1
- package/lib/primitives/__tests__/Btn.test.d.ts +0 -1
- package/lib/primitives/__tests__/Flex.test.d.ts +0 -1
- package/lib/primitives/__tests__/Link.test.d.ts +0 -1
- package/lib/primitives/__tests__/Svg.test.d.ts +0 -1
- package/lib/primitives/__tests__/Text.test.d.ts +0 -1
- package/lib/primitives/__tests__/primitives.test.d.ts +0 -1
- package/lib/primitives/__tests__/style-props.test.d.ts +0 -1
- package/lib/primitives/index.d.ts +0 -9
- package/lib/primitives/style-props.d.ts +0 -4
- package/lib/primitives/types.d.ts +0 -95
- package/lib/robot-types.d.ts +0 -1
- package/lib/slotmap/OT2SlotMap.d.ts +0 -9
- package/lib/slotmap/__tests__/OT2SlotMap.test.d.ts +0 -1
- package/lib/slotmap/index.d.ts +0 -1
- package/lib/structure/Card.d.ts +0 -18
- package/lib/structure/LabeledValue.d.ts +0 -12
- package/lib/structure/Pill.d.ts +0 -18
- package/lib/structure/Splash.d.ts +0 -8
- package/lib/structure/TitleBar.d.ts +0 -17
- package/lib/structure/index.d.ts +0 -5
- package/lib/styles/borders.d.ts +0 -8
- package/lib/styles/colors.d.ts +0 -37
- package/lib/styles/cursor.d.ts +0 -10
- package/lib/styles/flexbox.d.ts +0 -34
- package/lib/styles/index.d.ts +0 -8
- package/lib/styles/layout.d.ts +0 -24
- package/lib/styles/position.d.ts +0 -5
- package/lib/styles/spacing.d.ts +0 -9
- package/lib/styles/typography.d.ts +0 -36
- package/lib/testing/utils/index.d.ts +0 -2
- package/lib/testing/utils/matchers.d.ts +0 -3
- package/lib/testing/utils/renderWithProviders.d.ts +0 -9
- package/lib/tooltips/DeprecatedTooltip.d.ts +0 -37
- package/lib/tooltips/HoverTooltip.d.ts +0 -36
- package/lib/tooltips/LegacyTooltip.d.ts +0 -35
- package/lib/tooltips/__tests__/Tooltip.test.d.ts +0 -1
- package/lib/tooltips/__tests__/useHoverTooltip.test.d.ts +0 -1
- package/lib/tooltips/__tests__/usePopper.test.d.ts +0 -1
- package/lib/tooltips/__tests__/useTooltip.test.d.ts +0 -1
- package/lib/tooltips/constants.d.ts +0 -17
- package/lib/tooltips/index.d.ts +0 -8
- package/lib/tooltips/styles.d.ts +0 -12
- package/lib/tooltips/types.d.ts +0 -52
- package/lib/tooltips/useHoverTooltip.d.ts +0 -24
- package/lib/tooltips/usePopper.d.ts +0 -2
- package/lib/tooltips/useTooltip.d.ts +0 -31
- package/lib/ui-style-constants/index.d.ts +0 -4
- package/lib/ui-style-constants/responsiveness.d.ts +0 -3
- package/lib/ui-style-constants/spacing.d.ts +0 -18
- package/lib/ui-style-constants/typography.d.ts +0 -71
- package/lib/ui-style-constants/viewport.d.ts +0 -15
- package/lib/utils.d.ts +0 -15
- package/src/__tests__/utils.test.ts +0 -27
- package/src/alerts/alerts.module.css +0 -103
- package/src/atoms/Checkbox/__tests__/Checkbox.test.tsx +0 -55
- package/src/atoms/CheckboxField/__tests__/CheckboxField.test.tsx +0 -141
- package/src/atoms/Chip/__tests__/Chip.test.tsx +0 -429
- package/src/atoms/InputField/__tests__/InputField.test.tsx +0 -63
- package/src/atoms/ListButton/__tests__/ListButton.test.tsx +0 -46
- package/src/atoms/ListButton/__tests__/ListButtonAccordion.test.tsx +0 -35
- package/src/atoms/ListButton/__tests__/ListButtonRadioButton.test.tsx +0 -27
- package/src/atoms/ListItem/__tests__/ListItem.test.tsx +0 -61
- package/src/atoms/MenuList/__tests__/MenuItem.test.tsx +0 -50
- package/src/atoms/MenuList/__tests__/MenuList.test.tsx +0 -36
- package/src/atoms/MenuList/__tests__/OverflowBtn.test.tsx +0 -33
- package/src/atoms/Snackbar/__tests__/Snackbar.test.tsx +0 -73
- package/src/atoms/Tag/__tests__/Tag.test.tsx +0 -55
- package/src/atoms/Toast/__tests__/ODDToast.test.tsx +0 -178
- package/src/atoms/Toast/__tests__/Toast.test.tsx +0 -174
- package/src/atoms/ToggleGroup/__tests__/ToggleGroup.test.tsx +0 -28
- package/src/atoms/Tooltip/__tests__/Tooltip.test.tsx +0 -78
- package/src/atoms/buttons/__tests__/AlertPrimaryButton.test.tsx +0 -47
- package/src/atoms/buttons/__tests__/AltPrimaryButton.test.tsx +0 -57
- package/src/atoms/buttons/__tests__/EmptySelectorButton.test.tsx +0 -42
- package/src/atoms/buttons/__tests__/LargeButton.test.tsx +0 -91
- package/src/atoms/buttons/__tests__/PrimaryButton.test.tsx +0 -64
- package/src/atoms/buttons/__tests__/RadioButton.test.tsx +0 -98
- package/src/atoms/buttons/__tests__/SecondaryButton.test.tsx +0 -54
- package/src/buttons/buttons.module.css +0 -428
- package/src/controls/styles.module.css +0 -103
- package/src/forms/Select.module.css +0 -118
- package/src/forms/SelectField.module.css +0 -16
- package/src/forms/__tests__/DeprecatedCheckboxField.test.tsx +0 -5
- package/src/forms/__tests__/DropdownField.test.tsx +0 -5
- package/src/forms/__tests__/InputField.test.tsx +0 -5
- package/src/forms/__tests__/Select.test.tsx +0 -5
- package/src/forms/__tests__/SelectField.test.tsx +0 -5
- package/src/forms/__tests__/ToggleField.test.tsx +0 -5
- package/src/forms/forms.module.css +0 -239
- package/src/hardware-sim/Labware/__tests__/Labware.test.tsx +0 -43
- package/src/hardware-sim/Labware/__tests__/LabwareRender.test.tsx +0 -54
- package/src/hardware-sim/Labware/labwareInternals/__tests__/LabwareWellLabels.test.tsx +0 -66
- package/src/hardware-sim/Labware/labwareInternals/__tests__/StrokedWells.test.tsx +0 -31
- package/src/hardware-sim/Labware/labwareInternals/__tests__/WellLabels.test.tsx +0 -91
- package/src/hardware-sim/Pipette/__tests__/EightEmanatingNozzles.test.tsx +0 -16
- package/src/hardware-sim/Pipette/__tests__/EmanatingNozzle.test.tsx +0 -67
- package/src/hardware-sim/Pipette/__tests__/PipetteRender.test.tsx +0 -99
- package/src/hardware-sim/ProtocolDeck/utils/__tests__/getLabwareInforByLiquidId.test.ts +0 -158
- package/src/hooks/__tests__/useConditionalConfirm.test.tsx +0 -5
- package/src/hooks/__tests__/useDrag.test.ts +0 -46
- package/src/hooks/__tests__/useIdle.test.ts +0 -68
- package/src/hooks/__tests__/useInterval.test.tsx +0 -5
- package/src/hooks/__tests__/useLongPress.test.ts +0 -25
- package/src/hooks/__tests__/useMountEffect.test.tsx +0 -5
- package/src/hooks/__tests__/usePrevious.test.tsx +0 -5
- package/src/hooks/__tests__/useScrolling.test.tsx +0 -46
- package/src/hooks/__tests__/useSwipe.test.tsx +0 -26
- package/src/hooks/__tests__/useTimeout.test.tsx +0 -5
- package/src/hooks/__tests__/useToggle.test.tsx +0 -5
- package/src/index.module.css +0 -9
- package/src/instrument/PipetteSelect.module.css +0 -14
- package/src/instrument/__tests__/InstrumentInfo.test.tsx +0 -55
- package/src/instrument/__tests__/PipetteSelect.test.tsx +0 -4
- package/src/instrument/instrument.module.css +0 -45
- package/src/interaction-enhancers/__tests__/useHover.test.tsx +0 -4
- package/src/legacy-hardware-sim/LabwareNameOverlay.module.css +0 -20
- package/src/legacy-hardware-sim/ModuleItem.module.css +0 -98
- package/src/lists/lists.module.css +0 -171
- package/src/modals/__tests__/Modal.test.tsx +0 -65
- package/src/modals/__tests__/ModalHeader.test.tsx +0 -73
- package/src/modals/__tests__/ModalShell.test.tsx +0 -45
- package/src/modals/modals.module.css +0 -275
- package/src/molecules/Banner/__tests__/Banner.test.tsx +0 -94
- package/src/molecules/DeckInfoLabel/__tests__/DeckInfoLabel.test.tsx +0 -49
- package/src/molecules/DeckLabel/__tests__/DeckLabel.test.tsx +0 -69
- package/src/molecules/DropdownMenu/__tests__/DropdownMenu.test.tsx +0 -85
- package/src/molecules/InfoScreen/__tests__/InfoScreen.test.tsx +0 -40
- package/src/molecules/LiquidIcon/__tests__/LiquidIcon.test.tsx +0 -50
- package/src/molecules/ParametersTable/__tests__/ParametersTable.test.tsx +0 -126
- package/src/molecules/Tabs/__tests__/Tabs.test.tsx +0 -90
- package/src/nav/SidePanel.module.css +0 -34
- package/src/organisms/DeckLabelSet/__tests__/DeckLabelSet.test.tsx +0 -49
- package/src/organisms/EndUserAgreementFooter/__tests__/EndUserAgreementFooter.test.tsx +0 -21
- package/src/organisms/Toolbox/__tests__/Toolbox.test.tsx +0 -35
- package/src/primitives/__tests__/Box.test.tsx +0 -4
- package/src/primitives/__tests__/Btn.test.tsx +0 -4
- package/src/primitives/__tests__/Flex.test.tsx +0 -4
- package/src/primitives/__tests__/Link.test.tsx +0 -4
- package/src/primitives/__tests__/Svg.test.tsx +0 -4
- package/src/primitives/__tests__/Text.test.tsx +0 -4
- package/src/primitives/__tests__/primitives.test.tsx +0 -4
- package/src/primitives/__tests__/style-props.test.tsx +0 -4
- package/src/slotmap/__tests__/OT2SlotMap.test.tsx +0 -4
- package/src/slotmap/styles.module.css +0 -18
- package/src/structure/Pill.module.css +0 -16
- package/src/structure/Splash.module.css +0 -16
- package/src/structure/structure.module.css +0 -114
- package/src/styles/borders.module.css +0 -20
- package/src/styles/colors.module.css +0 -57
- package/src/styles/index.module.css +0 -8
- package/src/styles/typography.module.css +0 -22
- package/src/tooltips/__tests__/Tooltip.test.tsx +0 -4
- package/src/tooltips/__tests__/useHoverTooltip.test.tsx +0 -4
- package/src/tooltips/__tests__/usePopper.test.tsx +0 -4
- package/src/tooltips/__tests__/useTooltip.test.tsx +0 -4
- package/src/tooltips/tooltips.module.css +0 -72
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import type * as React from 'react'
|
|
2
|
-
import { describe, beforeEach, afterEach, vi, expect, it } from 'vitest'
|
|
3
|
-
import { fireEvent, screen } from '@testing-library/react'
|
|
4
|
-
import '@testing-library/jest-dom/vitest'
|
|
5
|
-
import { ALIGN_CENTER, JUSTIFY_CENTER } from '../../../styles'
|
|
6
|
-
import { renderWithProviders } from '../../../testing/utils'
|
|
7
|
-
import { BORDERS, COLORS } from '../../../helix-design-system'
|
|
8
|
-
import { TYPOGRAPHY, SPACING } from '../../../ui-style-constants'
|
|
9
|
-
import { CheckboxField } from '..'
|
|
10
|
-
|
|
11
|
-
const render = (props: React.ComponentProps<typeof CheckboxField>) => {
|
|
12
|
-
return renderWithProviders(<CheckboxField {...props} />)[0]
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
describe('CheckboxField', () => {
|
|
16
|
-
let props: React.ComponentProps<typeof CheckboxField>
|
|
17
|
-
|
|
18
|
-
beforeEach(() => {
|
|
19
|
-
props = {
|
|
20
|
-
onChange: vi.fn(),
|
|
21
|
-
value: false,
|
|
22
|
-
name: 'mockCheckboxField',
|
|
23
|
-
label: 'checkMockCheckboxField',
|
|
24
|
-
disabled: false,
|
|
25
|
-
isIndeterminate: false,
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
afterEach(() => {
|
|
30
|
-
vi.resetAllMocks()
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
it('renders label with correct style', () => {
|
|
34
|
-
render(props)
|
|
35
|
-
const checkBoxInput = screen.getByRole('checkbox', {
|
|
36
|
-
name: 'checkMockCheckboxField',
|
|
37
|
-
})
|
|
38
|
-
const checkBoxFieldBox = screen.getByText('checkMockCheckboxField')
|
|
39
|
-
const checkBoxIcon = screen.getByTestId('CheckboxField_icon')
|
|
40
|
-
|
|
41
|
-
// INNER_STYLE_NO_VALUE
|
|
42
|
-
expect(checkBoxIcon).toHaveStyle(`width: 1.25rem`)
|
|
43
|
-
expect(checkBoxIcon).toHaveStyle(`min-width: 1.25rem`)
|
|
44
|
-
expect(checkBoxIcon).toHaveStyle(`color: ${String(COLORS.grey50)}`)
|
|
45
|
-
expect(checkBoxIcon).toHaveStyle(`display: flex`)
|
|
46
|
-
expect(checkBoxIcon).toHaveStyle(
|
|
47
|
-
`border-radius: ${String(BORDERS.borderRadius2)}`
|
|
48
|
-
)
|
|
49
|
-
expect(checkBoxIcon).toHaveStyle(
|
|
50
|
-
`justify-content: ${String(JUSTIFY_CENTER)}`
|
|
51
|
-
)
|
|
52
|
-
expect(checkBoxIcon).toHaveStyle(`align-items: ${String(ALIGN_CENTER)}`)
|
|
53
|
-
|
|
54
|
-
// INPUT_STYLE
|
|
55
|
-
expect(checkBoxInput).toHaveStyle(`position: absolute`)
|
|
56
|
-
expect(checkBoxInput).toHaveStyle(`overflow: hidden`)
|
|
57
|
-
expect(checkBoxInput).toHaveStyle(`clip: rect(0 0 0 0)`)
|
|
58
|
-
expect(checkBoxInput).toHaveStyle(`height: 1px`)
|
|
59
|
-
expect(checkBoxInput).toHaveStyle(`width: 1px`)
|
|
60
|
-
expect(checkBoxInput).toHaveStyle(`margin: -1px`)
|
|
61
|
-
expect(checkBoxInput).toHaveStyle(`padding: 0`)
|
|
62
|
-
expect(checkBoxInput).toHaveStyle(`border: 0`)
|
|
63
|
-
expect(checkBoxInput).toHaveAttribute('tabindex', '0')
|
|
64
|
-
|
|
65
|
-
// LABEL_TEXT_STYLE
|
|
66
|
-
expect(checkBoxFieldBox).toHaveStyle(
|
|
67
|
-
`font-size: ${String(TYPOGRAPHY.fontSizeP)}`
|
|
68
|
-
)
|
|
69
|
-
expect(checkBoxFieldBox).toHaveStyle(
|
|
70
|
-
`font-weight: ${String(TYPOGRAPHY.fontWeightRegular)}`
|
|
71
|
-
)
|
|
72
|
-
expect(checkBoxFieldBox).toHaveStyle(`color: ${String(COLORS.black90)}`)
|
|
73
|
-
expect(checkBoxFieldBox).toHaveStyle(`flex: 0 0 auto`)
|
|
74
|
-
expect(checkBoxFieldBox).toHaveStyle(
|
|
75
|
-
`padding: ${SPACING.spacing8} ${SPACING.spacing8}`
|
|
76
|
-
)
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
it('render icon with correct style - value true', () => {
|
|
80
|
-
props.value = true
|
|
81
|
-
render(props)
|
|
82
|
-
const checkBoxIcon = screen.getByTestId('CheckboxField_icon')
|
|
83
|
-
expect(checkBoxIcon).toHaveStyle(`width: 1.25rem`)
|
|
84
|
-
expect(checkBoxIcon).toHaveStyle(`min-width: 1.25rem`)
|
|
85
|
-
expect(checkBoxIcon).toHaveStyle(`color: ${String(COLORS.blue50)}`)
|
|
86
|
-
expect(checkBoxIcon).toHaveStyle(`display: flex`)
|
|
87
|
-
expect(checkBoxIcon).toHaveStyle(
|
|
88
|
-
`border-radius: ${String(BORDERS.borderRadius2)}`
|
|
89
|
-
)
|
|
90
|
-
expect(checkBoxIcon).toHaveStyle(
|
|
91
|
-
`justify-content: ${String(JUSTIFY_CENTER)}`
|
|
92
|
-
)
|
|
93
|
-
expect(checkBoxIcon).toHaveStyle(`align-items: ${String(ALIGN_CENTER)}`)
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
it('renders label with correct style - value undefined', () => {
|
|
97
|
-
props.value = undefined
|
|
98
|
-
render(props)
|
|
99
|
-
const checkBoxIcon = screen.getByTestId('CheckboxField_icon')
|
|
100
|
-
expect(checkBoxIcon).toHaveStyle(`width: 1.25rem`)
|
|
101
|
-
expect(checkBoxIcon).toHaveStyle(`min-width: 1.25rem`)
|
|
102
|
-
expect(checkBoxIcon).toHaveStyle(`color: ${String(COLORS.grey50)}`)
|
|
103
|
-
expect(checkBoxIcon).toHaveStyle(`display: flex`)
|
|
104
|
-
expect(checkBoxIcon).toHaveStyle(
|
|
105
|
-
`border-radius: ${String(BORDERS.borderRadius2)}`
|
|
106
|
-
)
|
|
107
|
-
expect(checkBoxIcon).toHaveStyle(
|
|
108
|
-
`justify-content: ${String(JUSTIFY_CENTER)}`
|
|
109
|
-
)
|
|
110
|
-
expect(checkBoxIcon).toHaveStyle(`align-items: ${String(ALIGN_CENTER)}`)
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
it('renders label with correct style - disabled true', () => {
|
|
114
|
-
props.disabled = true
|
|
115
|
-
render(props)
|
|
116
|
-
const checkBoxInput = screen.getByRole('checkbox', {
|
|
117
|
-
name: 'checkMockCheckboxField',
|
|
118
|
-
})
|
|
119
|
-
expect(checkBoxInput).toBeDisabled()
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
it('renders label with correct style - tabIndex 1', () => {
|
|
123
|
-
props.tabIndex = 1
|
|
124
|
-
render(props)
|
|
125
|
-
const checkBoxInput = screen.getByRole('checkbox', {
|
|
126
|
-
name: 'checkMockCheckboxField',
|
|
127
|
-
})
|
|
128
|
-
const checkBoxFieldBox = screen.getByText('checkMockCheckboxField')
|
|
129
|
-
expect(checkBoxInput).toHaveAttribute('tabindex', '1')
|
|
130
|
-
expect(checkBoxFieldBox).toHaveAttribute('tabindex', '1')
|
|
131
|
-
})
|
|
132
|
-
|
|
133
|
-
it('calls mock function when clicking checkboxfield', () => {
|
|
134
|
-
render(props)
|
|
135
|
-
const checkBoxInput = screen.getByRole('checkbox', {
|
|
136
|
-
name: 'checkMockCheckboxField',
|
|
137
|
-
})
|
|
138
|
-
fireEvent.click(checkBoxInput)
|
|
139
|
-
expect(props.onChange).toHaveBeenCalled()
|
|
140
|
-
})
|
|
141
|
-
})
|
|
@@ -1,429 +0,0 @@
|
|
|
1
|
-
import type * as React from 'react'
|
|
2
|
-
import { describe, it, expect, beforeEach } from 'vitest'
|
|
3
|
-
import { screen } from '@testing-library/react'
|
|
4
|
-
import { BORDERS, COLORS } from '../../../helix-design-system'
|
|
5
|
-
import { SPACING } from '../../../ui-style-constants'
|
|
6
|
-
import { renderWithProviders } from '../../../testing/utils'
|
|
7
|
-
import { Chip } from '..'
|
|
8
|
-
|
|
9
|
-
const render = (props: React.ComponentProps<typeof Chip>) => {
|
|
10
|
-
return renderWithProviders(<Chip {...props} />)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
describe('Chip Touchscreen', () => {
|
|
14
|
-
let props: React.ComponentProps<typeof Chip>
|
|
15
|
-
|
|
16
|
-
it('should render text, icon, bgcolor with success colors', () => {
|
|
17
|
-
props = {
|
|
18
|
-
text: 'mockSuccess',
|
|
19
|
-
type: 'success',
|
|
20
|
-
}
|
|
21
|
-
render(props)
|
|
22
|
-
const chip = screen.getByTestId('Chip_success')
|
|
23
|
-
const chipText = screen.getByText('mockSuccess')
|
|
24
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.green35}`)
|
|
25
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
26
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.green60}`)
|
|
27
|
-
const icon = screen.getByLabelText('icon_mockSuccess')
|
|
28
|
-
expect(icon).toHaveStyle(`color: ${COLORS.green60}`)
|
|
29
|
-
// ToDo (kk:03/28/2024) seems that jsdom doesn't support switching via media query
|
|
30
|
-
// I will keep investigating this
|
|
31
|
-
// expect(icon).toHaveStyle(`width: 1.5rem`)
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
it('should render text, icon, no bgcolor with success colors and bg false', () => {
|
|
35
|
-
props = {
|
|
36
|
-
background: false,
|
|
37
|
-
text: 'mockSuccess',
|
|
38
|
-
type: 'success',
|
|
39
|
-
}
|
|
40
|
-
render(props)
|
|
41
|
-
const chip = screen.getByTestId('Chip_success')
|
|
42
|
-
const chipText = screen.getByText('mockSuccess')
|
|
43
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.transparent}`)
|
|
44
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
45
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.green60}`)
|
|
46
|
-
const icon = screen.getByLabelText('icon_mockSuccess')
|
|
47
|
-
expect(icon).toHaveStyle(`color: ${COLORS.green60}`)
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
it('should render text, icon, bgcolor with warning colors', () => {
|
|
51
|
-
props = {
|
|
52
|
-
text: 'mockWarning',
|
|
53
|
-
type: 'warning',
|
|
54
|
-
}
|
|
55
|
-
render(props)
|
|
56
|
-
const chip = screen.getByTestId('Chip_warning')
|
|
57
|
-
const chipText = screen.getByText('mockWarning')
|
|
58
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.yellow35}`)
|
|
59
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
60
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.yellow60}`)
|
|
61
|
-
const icon = screen.getByLabelText('icon_mockWarning')
|
|
62
|
-
expect(icon).toHaveStyle(`color: ${COLORS.yellow60}`)
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
it('should render text, icon, no bgcolor with warning colors and bg false', () => {
|
|
66
|
-
props = {
|
|
67
|
-
background: false,
|
|
68
|
-
text: 'mockWarning',
|
|
69
|
-
type: 'warning',
|
|
70
|
-
}
|
|
71
|
-
render(props)
|
|
72
|
-
const chip = screen.getByTestId('Chip_warning')
|
|
73
|
-
const chipText = screen.getByText('mockWarning')
|
|
74
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.transparent}`)
|
|
75
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
76
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.yellow60}`)
|
|
77
|
-
const icon = screen.getByLabelText('icon_mockWarning')
|
|
78
|
-
expect(icon).toHaveStyle(`color: ${COLORS.yellow60}`)
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
it('should render text, icon, bgcolor with neutral colors', () => {
|
|
82
|
-
props = {
|
|
83
|
-
text: 'mockNeutral',
|
|
84
|
-
type: 'neutral',
|
|
85
|
-
}
|
|
86
|
-
render(props)
|
|
87
|
-
const chip = screen.getByTestId('Chip_neutral')
|
|
88
|
-
const chipText = screen.getByText('mockNeutral')
|
|
89
|
-
expect(chip).toHaveStyle(
|
|
90
|
-
`background-color: ${COLORS.black90}${COLORS.opacity20HexCode}`
|
|
91
|
-
)
|
|
92
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
93
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.grey60}`)
|
|
94
|
-
const icon = screen.getByLabelText('icon_mockNeutral')
|
|
95
|
-
expect(icon).toHaveStyle(`color: ${COLORS.grey60}`)
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
it('should render text, icon, no bgcolor with neutral colors and bg false', () => {
|
|
99
|
-
props = {
|
|
100
|
-
background: false,
|
|
101
|
-
text: 'mockNeutral',
|
|
102
|
-
type: 'neutral',
|
|
103
|
-
}
|
|
104
|
-
render(props)
|
|
105
|
-
const chip = screen.getByTestId('Chip_neutral')
|
|
106
|
-
const chipText = screen.getByText('mockNeutral')
|
|
107
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.transparent}`)
|
|
108
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
109
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.grey60}`)
|
|
110
|
-
const icon = screen.getByLabelText('icon_mockNeutral')
|
|
111
|
-
expect(icon).toHaveStyle(`color: ${COLORS.grey60}`)
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
it('should render text, icon, bgcolor with error colors', () => {
|
|
115
|
-
props = {
|
|
116
|
-
text: 'mockError',
|
|
117
|
-
type: 'error',
|
|
118
|
-
}
|
|
119
|
-
render(props)
|
|
120
|
-
const chip = screen.getByTestId('Chip_error')
|
|
121
|
-
const chipText = screen.getByText('mockError')
|
|
122
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.red35}`)
|
|
123
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
124
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.red60}`)
|
|
125
|
-
const icon = screen.getByLabelText('icon_mockError')
|
|
126
|
-
expect(icon).toHaveStyle(`color: ${COLORS.red60}`)
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
it('should render text, icon, no bgcolor with error colors and bg false', () => {
|
|
130
|
-
props = {
|
|
131
|
-
background: false,
|
|
132
|
-
text: 'mockError',
|
|
133
|
-
type: 'error',
|
|
134
|
-
}
|
|
135
|
-
render(props)
|
|
136
|
-
const chip = screen.getByTestId('Chip_error')
|
|
137
|
-
const chipText = screen.getByText('mockError')
|
|
138
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.transparent}`)
|
|
139
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
140
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.red60}`)
|
|
141
|
-
const icon = screen.getByLabelText('icon_mockError')
|
|
142
|
-
expect(icon).toHaveStyle(`color: ${COLORS.red60}`)
|
|
143
|
-
})
|
|
144
|
-
|
|
145
|
-
it('should render text, icon, bgcolor with info colors', () => {
|
|
146
|
-
props = {
|
|
147
|
-
text: 'mockInfo',
|
|
148
|
-
type: 'info',
|
|
149
|
-
}
|
|
150
|
-
render(props)
|
|
151
|
-
const chip = screen.getByTestId('Chip_info')
|
|
152
|
-
const chipText = screen.getByText('mockInfo')
|
|
153
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.blue35}`)
|
|
154
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
155
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.blue60}`)
|
|
156
|
-
const icon = screen.getByLabelText('icon_mockInfo')
|
|
157
|
-
expect(icon).toHaveStyle(`color: ${COLORS.blue60}`)
|
|
158
|
-
})
|
|
159
|
-
|
|
160
|
-
it('should render text, icon, no bgcolor with info colors and bg false', () => {
|
|
161
|
-
props = {
|
|
162
|
-
background: false,
|
|
163
|
-
text: 'mockInfo',
|
|
164
|
-
type: 'info',
|
|
165
|
-
}
|
|
166
|
-
render(props)
|
|
167
|
-
const chip = screen.getByTestId('Chip_info')
|
|
168
|
-
const chipText = screen.getByText('mockInfo')
|
|
169
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.transparent}`)
|
|
170
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
171
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.blue60}`)
|
|
172
|
-
const icon = screen.getByLabelText('icon_mockInfo')
|
|
173
|
-
expect(icon).toHaveStyle(`color: ${COLORS.blue60}`)
|
|
174
|
-
})
|
|
175
|
-
it('renders no icon when hasIcon is false', () => {
|
|
176
|
-
props = {
|
|
177
|
-
text: 'mockInfo',
|
|
178
|
-
hasIcon: false,
|
|
179
|
-
type: 'info',
|
|
180
|
-
}
|
|
181
|
-
render(props)
|
|
182
|
-
expect(screen.queryByText('icon_mockInfo')).not.toBeInTheDocument()
|
|
183
|
-
})
|
|
184
|
-
|
|
185
|
-
it('render text with smaller padding and smaller icon when chip size is small and background is false', () => {
|
|
186
|
-
props = {
|
|
187
|
-
background: false,
|
|
188
|
-
text: 'mockInfo',
|
|
189
|
-
type: 'info',
|
|
190
|
-
chipSize: 'small',
|
|
191
|
-
}
|
|
192
|
-
render(props)
|
|
193
|
-
const chip = screen.getByTestId('Chip_info')
|
|
194
|
-
expect(chip).toHaveStyle(`padding: ${SPACING.spacing4} 0`)
|
|
195
|
-
const icon = screen.getByLabelText('icon_mockInfo')
|
|
196
|
-
expect(icon).toHaveStyle(`width: 0.75rem`)
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
// ToDo (kk:03/28/2024) seems that jsdom doesn't support switching via media query
|
|
200
|
-
// I will keep investigating this
|
|
201
|
-
// it('render text with smaller padding and smaller icon when chip size is small and background is true', () => {
|
|
202
|
-
// props = {
|
|
203
|
-
// background: true,
|
|
204
|
-
// text: 'mockInfo',
|
|
205
|
-
// type: 'info',
|
|
206
|
-
// chipSize: 'small',
|
|
207
|
-
// }
|
|
208
|
-
// render(props)
|
|
209
|
-
// const chip = screen.getByTestId('Chip_info')
|
|
210
|
-
// expect(chip).toHaveStyle(`padding: ${SPACING.spacing4} ${SPACING.spacing8}`)
|
|
211
|
-
// const icon = screen.getByLabelText('icon_mockInfo')
|
|
212
|
-
// expect(icon).toHaveStyle(`width: 1.25rem`)
|
|
213
|
-
// })
|
|
214
|
-
})
|
|
215
|
-
|
|
216
|
-
describe('Chip Web', () => {
|
|
217
|
-
let props: React.ComponentProps<typeof Chip>
|
|
218
|
-
|
|
219
|
-
beforeEach(() => {
|
|
220
|
-
Object.defineProperty(window, 'innerWidth', {
|
|
221
|
-
writable: true,
|
|
222
|
-
configurable: true,
|
|
223
|
-
value: 1024,
|
|
224
|
-
})
|
|
225
|
-
|
|
226
|
-
Object.defineProperty(window, 'innerHeight', {
|
|
227
|
-
writable: true,
|
|
228
|
-
configurable: true,
|
|
229
|
-
value: 768,
|
|
230
|
-
})
|
|
231
|
-
})
|
|
232
|
-
it('should render text, icon, bgcolor with success colors', () => {
|
|
233
|
-
props = {
|
|
234
|
-
text: 'mockSuccess',
|
|
235
|
-
type: 'success',
|
|
236
|
-
}
|
|
237
|
-
render(props)
|
|
238
|
-
const chip = screen.getByTestId('Chip_success')
|
|
239
|
-
const chipText = screen.getByText('mockSuccess')
|
|
240
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.green35}`)
|
|
241
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
242
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.green60}`)
|
|
243
|
-
// expect(chipText).toHaveStyle(
|
|
244
|
-
// `padding: ${SPACING.spacing2} ${SPACING.spacing8}`
|
|
245
|
-
// )
|
|
246
|
-
const icon = screen.getByLabelText('icon_mockSuccess')
|
|
247
|
-
expect(icon).toHaveStyle(`color: ${COLORS.green60}`)
|
|
248
|
-
expect(icon).toHaveStyle(`width: 1rem`)
|
|
249
|
-
})
|
|
250
|
-
|
|
251
|
-
it('should render text, icon, no bgcolor with success colors and bg false', () => {
|
|
252
|
-
props = {
|
|
253
|
-
background: false,
|
|
254
|
-
text: 'mockSuccess',
|
|
255
|
-
type: 'success',
|
|
256
|
-
}
|
|
257
|
-
render(props)
|
|
258
|
-
const chip = screen.getByTestId('Chip_success')
|
|
259
|
-
const chipText = screen.getByText('mockSuccess')
|
|
260
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.transparent}`)
|
|
261
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
262
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.green60}`)
|
|
263
|
-
const icon = screen.getByLabelText('icon_mockSuccess')
|
|
264
|
-
expect(icon).toHaveStyle(`color: ${COLORS.green60}`)
|
|
265
|
-
})
|
|
266
|
-
|
|
267
|
-
it('should render text, icon, bgcolor with warning colors', () => {
|
|
268
|
-
props = {
|
|
269
|
-
text: 'mockWarning',
|
|
270
|
-
type: 'warning',
|
|
271
|
-
}
|
|
272
|
-
render(props)
|
|
273
|
-
const chip = screen.getByTestId('Chip_warning')
|
|
274
|
-
const chipText = screen.getByText('mockWarning')
|
|
275
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.yellow35}`)
|
|
276
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
277
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.yellow60}`)
|
|
278
|
-
const icon = screen.getByLabelText('icon_mockWarning')
|
|
279
|
-
expect(icon).toHaveStyle(`color: ${COLORS.yellow60}`)
|
|
280
|
-
})
|
|
281
|
-
|
|
282
|
-
it('should render text, icon, no bgcolor with warning colors and bg false', () => {
|
|
283
|
-
props = {
|
|
284
|
-
background: false,
|
|
285
|
-
text: 'mockWarning',
|
|
286
|
-
type: 'warning',
|
|
287
|
-
}
|
|
288
|
-
render(props)
|
|
289
|
-
const chip = screen.getByTestId('Chip_warning')
|
|
290
|
-
const chipText = screen.getByText('mockWarning')
|
|
291
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.transparent}`)
|
|
292
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
293
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.yellow60}`)
|
|
294
|
-
const icon = screen.getByLabelText('icon_mockWarning')
|
|
295
|
-
expect(icon).toHaveStyle(`color: ${COLORS.yellow60}`)
|
|
296
|
-
})
|
|
297
|
-
|
|
298
|
-
it('should render text, icon, bgcolor with neutral colors', () => {
|
|
299
|
-
props = {
|
|
300
|
-
text: 'mockNeutral',
|
|
301
|
-
type: 'neutral',
|
|
302
|
-
}
|
|
303
|
-
render(props)
|
|
304
|
-
const chip = screen.getByTestId('Chip_neutral')
|
|
305
|
-
const chipText = screen.getByText('mockNeutral')
|
|
306
|
-
expect(chip).toHaveStyle(
|
|
307
|
-
`background-color: ${COLORS.black90}${COLORS.opacity20HexCode}`
|
|
308
|
-
)
|
|
309
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
310
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.grey60}`)
|
|
311
|
-
const icon = screen.getByLabelText('icon_mockNeutral')
|
|
312
|
-
expect(icon).toHaveStyle(`color: ${COLORS.grey60}`)
|
|
313
|
-
})
|
|
314
|
-
|
|
315
|
-
it('should render text, icon, no bgcolor with neutral colors and bg false', () => {
|
|
316
|
-
props = {
|
|
317
|
-
background: false,
|
|
318
|
-
text: 'mockNeutral',
|
|
319
|
-
type: 'neutral',
|
|
320
|
-
}
|
|
321
|
-
render(props)
|
|
322
|
-
const chip = screen.getByTestId('Chip_neutral')
|
|
323
|
-
const chipText = screen.getByText('mockNeutral')
|
|
324
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.transparent}`)
|
|
325
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
326
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.grey60}`)
|
|
327
|
-
const icon = screen.getByLabelText('icon_mockNeutral')
|
|
328
|
-
expect(icon).toHaveStyle(`color: ${COLORS.grey60}`)
|
|
329
|
-
})
|
|
330
|
-
|
|
331
|
-
it('should render text, icon, bgcolor with error colors', () => {
|
|
332
|
-
props = {
|
|
333
|
-
text: 'mockError',
|
|
334
|
-
type: 'error',
|
|
335
|
-
}
|
|
336
|
-
render(props)
|
|
337
|
-
const chip = screen.getByTestId('Chip_error')
|
|
338
|
-
const chipText = screen.getByText('mockError')
|
|
339
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.red35}`)
|
|
340
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
341
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.red60}`)
|
|
342
|
-
const icon = screen.getByLabelText('icon_mockError')
|
|
343
|
-
expect(icon).toHaveStyle(`color: ${COLORS.red60}`)
|
|
344
|
-
})
|
|
345
|
-
|
|
346
|
-
it('should render text, icon, no bgcolor with error colors and bg false', () => {
|
|
347
|
-
props = {
|
|
348
|
-
background: false,
|
|
349
|
-
text: 'mockError',
|
|
350
|
-
type: 'error',
|
|
351
|
-
}
|
|
352
|
-
render(props)
|
|
353
|
-
const chip = screen.getByTestId('Chip_error')
|
|
354
|
-
const chipText = screen.getByText('mockError')
|
|
355
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.transparent}`)
|
|
356
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
357
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.red60}`)
|
|
358
|
-
const icon = screen.getByLabelText('icon_mockError')
|
|
359
|
-
expect(icon).toHaveStyle(`color: ${COLORS.red60}`)
|
|
360
|
-
})
|
|
361
|
-
|
|
362
|
-
it('should render text, icon, bgcolor with info colors', () => {
|
|
363
|
-
props = {
|
|
364
|
-
text: 'mockInfo',
|
|
365
|
-
type: 'info',
|
|
366
|
-
}
|
|
367
|
-
render(props)
|
|
368
|
-
const chip = screen.getByTestId('Chip_info')
|
|
369
|
-
const chipText = screen.getByText('mockInfo')
|
|
370
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.blue35}`)
|
|
371
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
372
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.blue60}`)
|
|
373
|
-
const icon = screen.getByLabelText('icon_mockInfo')
|
|
374
|
-
expect(icon).toHaveStyle(`color: ${COLORS.blue60}`)
|
|
375
|
-
})
|
|
376
|
-
|
|
377
|
-
it('should render text, icon, no bgcolor with info colors and bg false', () => {
|
|
378
|
-
props = {
|
|
379
|
-
background: false,
|
|
380
|
-
text: 'mockInfo',
|
|
381
|
-
type: 'info',
|
|
382
|
-
}
|
|
383
|
-
render(props)
|
|
384
|
-
const chip = screen.getByTestId('Chip_info')
|
|
385
|
-
const chipText = screen.getByText('mockInfo')
|
|
386
|
-
expect(chip).toHaveStyle(`background-color: ${COLORS.transparent}`)
|
|
387
|
-
expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusFull}`)
|
|
388
|
-
expect(chipText).toHaveStyle(`color: ${COLORS.blue60}`)
|
|
389
|
-
const icon = screen.getByLabelText('icon_mockInfo')
|
|
390
|
-
expect(icon).toHaveStyle(`color: ${COLORS.blue60}`)
|
|
391
|
-
})
|
|
392
|
-
it('renders no icon when hasIcon is false', () => {
|
|
393
|
-
props = {
|
|
394
|
-
text: 'mockInfo',
|
|
395
|
-
hasIcon: false,
|
|
396
|
-
type: 'info',
|
|
397
|
-
}
|
|
398
|
-
render(props)
|
|
399
|
-
expect(screen.queryByText('icon_mockInfo')).not.toBeInTheDocument()
|
|
400
|
-
})
|
|
401
|
-
|
|
402
|
-
it('render text with smaller padding and smaller icon when chip size is small and background is false', () => {
|
|
403
|
-
props = {
|
|
404
|
-
background: false,
|
|
405
|
-
text: 'mockInfo',
|
|
406
|
-
type: 'info',
|
|
407
|
-
chipSize: 'small',
|
|
408
|
-
}
|
|
409
|
-
render(props)
|
|
410
|
-
const chip = screen.getByTestId('Chip_info')
|
|
411
|
-
expect(chip).toHaveStyle(`padding: ${SPACING.spacing4} 0`)
|
|
412
|
-
const icon = screen.getByLabelText('icon_mockInfo')
|
|
413
|
-
expect(icon).toHaveStyle(`width: 0.75rem`)
|
|
414
|
-
})
|
|
415
|
-
|
|
416
|
-
it('render text with smaller padding and smaller icon when chip size is small and background is true', () => {
|
|
417
|
-
props = {
|
|
418
|
-
background: true,
|
|
419
|
-
text: 'mockInfo',
|
|
420
|
-
type: 'info',
|
|
421
|
-
chipSize: 'small',
|
|
422
|
-
}
|
|
423
|
-
render(props)
|
|
424
|
-
const chip = screen.getByTestId('Chip_info')
|
|
425
|
-
expect(chip).toHaveStyle(`padding: ${SPACING.spacing4} ${SPACING.spacing6}`)
|
|
426
|
-
const icon = screen.getByLabelText('icon_mockInfo')
|
|
427
|
-
expect(icon).toHaveStyle(`width: 0.75rem`)
|
|
428
|
-
})
|
|
429
|
-
})
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type * as React from 'react'
|
|
2
|
-
import { describe, it, vi, beforeEach, expect } from 'vitest'
|
|
3
|
-
import { screen, fireEvent } from '@testing-library/react'
|
|
4
|
-
import { renderWithProviders } from '../../../testing/utils'
|
|
5
|
-
import { InputField } from '..'
|
|
6
|
-
|
|
7
|
-
const render = (props: React.ComponentProps<typeof InputField>) => {
|
|
8
|
-
return renderWithProviders(<InputField {...props} />)[0]
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
describe('HeaterShakerSlideout', () => {
|
|
12
|
-
let props: React.ComponentProps<typeof InputField>
|
|
13
|
-
beforeEach(() => {
|
|
14
|
-
props = {
|
|
15
|
-
type: 'number',
|
|
16
|
-
caption: 'caption',
|
|
17
|
-
max: 10,
|
|
18
|
-
min: 1,
|
|
19
|
-
units: 'rpm',
|
|
20
|
-
value: '5',
|
|
21
|
-
disabled: false,
|
|
22
|
-
onFocus: vi.fn(),
|
|
23
|
-
onBlur: vi.fn(),
|
|
24
|
-
onChange: vi.fn(),
|
|
25
|
-
readOnly: false,
|
|
26
|
-
autoFocus: false,
|
|
27
|
-
}
|
|
28
|
-
})
|
|
29
|
-
it('renders correct information when type is number', () => {
|
|
30
|
-
render(props)
|
|
31
|
-
screen.getByText('caption')
|
|
32
|
-
screen.getByText('rpm')
|
|
33
|
-
})
|
|
34
|
-
it('renders correct information when type is text', () => {
|
|
35
|
-
props = {
|
|
36
|
-
type: 'text',
|
|
37
|
-
value: 'string',
|
|
38
|
-
units: 'C',
|
|
39
|
-
onChange: vi.fn(),
|
|
40
|
-
}
|
|
41
|
-
render(props)
|
|
42
|
-
screen.getByText('C')
|
|
43
|
-
})
|
|
44
|
-
it('renders error message when value is outside of number type range', () => {
|
|
45
|
-
props = {
|
|
46
|
-
type: 'number',
|
|
47
|
-
caption: 'caption',
|
|
48
|
-
max: 10,
|
|
49
|
-
min: 1,
|
|
50
|
-
units: 'rpm',
|
|
51
|
-
value: '9',
|
|
52
|
-
error: 'error',
|
|
53
|
-
onChange: vi.fn(),
|
|
54
|
-
id: 'input_id',
|
|
55
|
-
}
|
|
56
|
-
render(props)
|
|
57
|
-
const input = screen.getByTestId('input_id')
|
|
58
|
-
fireEvent.change(input, { target: { value: ['12'] } })
|
|
59
|
-
expect(props.onChange).toHaveBeenCalled()
|
|
60
|
-
screen.getByText('caption')
|
|
61
|
-
screen.getByText('error')
|
|
62
|
-
})
|
|
63
|
-
})
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type * as React from 'react'
|
|
2
|
-
import { vi, describe, it, expect, beforeEach } from 'vitest'
|
|
3
|
-
import '@testing-library/jest-dom/vitest'
|
|
4
|
-
import { fireEvent, screen } from '@testing-library/react'
|
|
5
|
-
import { renderWithProviders } from '../../../testing/utils'
|
|
6
|
-
import { COLORS } from '../../../helix-design-system'
|
|
7
|
-
|
|
8
|
-
import { ListButton } from '..'
|
|
9
|
-
|
|
10
|
-
const render = (props: React.ComponentProps<typeof ListButton>) =>
|
|
11
|
-
renderWithProviders(<ListButton {...props} />)
|
|
12
|
-
|
|
13
|
-
describe('ListButton', () => {
|
|
14
|
-
let props: React.ComponentProps<typeof ListButton>
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
props = {
|
|
18
|
-
type: 'noActive',
|
|
19
|
-
children: <div>mock ListButton content</div>,
|
|
20
|
-
onClick: vi.fn(),
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
it('should render correct style - noActive', () => {
|
|
25
|
-
render(props)
|
|
26
|
-
const listButton = screen.getByTestId('ListButton_noActive')
|
|
27
|
-
expect(listButton).toHaveStyle(`backgroundColor: ${COLORS.grey30}`)
|
|
28
|
-
})
|
|
29
|
-
it('should render correct style - connected', () => {
|
|
30
|
-
props.type = 'connected'
|
|
31
|
-
render(props)
|
|
32
|
-
const listButton = screen.getByTestId('ListButton_connected')
|
|
33
|
-
expect(listButton).toHaveStyle(`backgroundColor: ${COLORS.green30}`)
|
|
34
|
-
})
|
|
35
|
-
it('should render correct style - notConnected', () => {
|
|
36
|
-
props.type = 'notConnected'
|
|
37
|
-
render(props)
|
|
38
|
-
const listButton = screen.getByTestId('ListButton_notConnected')
|
|
39
|
-
expect(listButton).toHaveStyle(`backgroundColor: ${COLORS.yellow30}`)
|
|
40
|
-
})
|
|
41
|
-
it('should call on click when pressed', () => {
|
|
42
|
-
render(props)
|
|
43
|
-
fireEvent.click(screen.getByText('mock ListButton content'))
|
|
44
|
-
expect(props.onClick).toHaveBeenCalled()
|
|
45
|
-
})
|
|
46
|
-
})
|