From b37bda2635babe40364d033b03a8e7ec6c5c18e4 Mon Sep 17 00:00:00 2001
From: Jeff Puzzo
Date: Mon, 18 Apr 2022 11:12:45 -0400
Subject: [PATCH 1/2] chore: Add setup to always include jest-dom extended
matchers, cleanup
---
jest.config.js | 1 +
.../CatalogItemHeader.test.tsx | 4 +-
.../CatalogItemHeader.test.tsx.snap | 4 +-
.../CatalogTile/CatalogTile.test.tsx | 11 +-
.../__snapshots__/CatalogTile.test.tsx.snap | 4 +-
.../VerticalTabs/VerticalTabs.test.tsx | 3 +-
.../src/components/Chart/Chart.test.tsx | 8 +-
.../Chart/__snapshots__/Chart.test.tsx.snap | 12 +-
.../components/ChartArea/ChartArea.test.tsx | 8 +-
.../__snapshots__/ChartArea.test.tsx.snap | 12 +-
.../components/ChartAxis/ChartAxis.test.tsx | 8 +-
.../__snapshots__/ChartAxis.test.tsx.snap | 12 +-
.../src/components/ChartBar/ChartBar.test.tsx | 8 +-
.../__snapshots__/ChartBar.test.tsx.snap | 12 +-
.../ChartBullet/ChartBullet.test.tsx | 8 +-
...hartBulletComparativeErrorMeasure.test.tsx | 10 +-
.../ChartBulletComparativeMeasure.test.tsx | 10 +-
...rtBulletComparativeWarningMeasure.test.tsx | 8 +-
.../ChartBulletGroupTitle.test.tsx | 8 +-
.../ChartBulletPrimaryDotMeasure.test.tsx | 8 +-
...hartBulletPrimarySegmentedMeasure.test.tsx | 8 +-
.../ChartBulletQualitativeRange.test.tsx | 8 +-
.../ChartBullet/ChartBulletTitle.test.tsx | 8 +-
.../__snapshots__/ChartBullet.test.tsx.snap | 12 +-
...ulletComparativeErrorMeasure.test.tsx.snap | 12 +-
...hartBulletComparativeMeasure.test.tsx.snap | 12 +-
...letComparativeWarningMeasure.test.tsx.snap | 12 +-
.../ChartBulletGroupTitle.test.tsx.snap | 12 +-
...ChartBulletPrimaryDotMeasure.test.tsx.snap | 12 +-
...ulletPrimarySegmentedMeasure.test.tsx.snap | 12 +-
.../ChartBulletQualitativeRange.test.tsx.snap | 12 +-
.../ChartBulletTitle.test.tsx.snap | 12 +-
.../ChartContainer/ChartContainer.test.tsx | 8 +-
.../ChartContainer.test.tsx.snap | 12 +-
.../ChartCursorContainer.test.tsx | 8 +-
.../ChartCursorContainer.test.tsx.snap | 12 +-
.../ChartCursorFlyout.test.tsx | 12 +-
.../ChartCursorTooltip.test.tsx | 13 +-
.../ChartCursorFlyout.test.tsx.snap | 8 +-
.../ChartCursorTooltip.test.tsx.snap | 8 +-
.../components/ChartDonut/ChartDonut.test.tsx | 8 +-
.../__snapshots__/ChartDonut.test.tsx.snap | 12 +-
.../ChartDonutThreshold.test.tsx | 8 +-
.../ChartDonutUtilization.test.tsx | 8 +-
.../ChartDonutThreshold.test.tsx.snap | 12 +-
.../ChartDonutUtilization.test.tsx.snap | 12 +-
.../components/ChartGroup/ChartGroup.test.tsx | 8 +-
.../__snapshots__/ChartGroup.test.tsx.snap | 12 +-
.../components/ChartLabel/ChartLabel.test.tsx | 8 +-
.../__snapshots__/ChartLabel.test.tsx.snap | 8 +-
.../ChartLegend/ChartLegend.test.tsx | 8 +-
.../__snapshots__/ChartLegend.test.tsx.snap | 12 +-
.../ChartLegendTooltip.test.tsx | 14 +-
.../ChartLegendTooltipContent.test.tsx | 8 +-
.../ChartLegendTooltipLabel.test.tsx | 8 +-
.../ChartLegendTooltip.test.tsx.snap | 8 +-
.../ChartLegendTooltipContent.test.tsx.snap | 12 +-
.../ChartLegendTooltipLabel.test.tsx.snap | 8 +-
.../components/ChartLine/ChartLine.test.tsx | 8 +-
.../__snapshots__/ChartLine.test.tsx.snap | 12 +-
.../src/components/ChartPie/ChartPie.test.tsx | 8 +-
.../__snapshots__/ChartPie.test.tsx.snap | 12 +-
.../components/ChartPoint/ChartPoint.test.tsx | 8 +-
.../__snapshots__/ChartPoint.test.tsx.snap | 12 +-
.../ChartScatter/ChartScatter.test.tsx | 8 +-
.../__snapshots__/ChartScatter.test.tsx.snap | 12 +-
.../components/ChartStack/ChartStack.test.tsx | 8 +-
.../__snapshots__/ChartStack.test.tsx.snap | 12 +-
.../ChartThreshold/ChartThreshold.test.tsx | 8 +-
.../ChartThreshold.test.tsx.snap | 12 +-
.../ChartTooltip/ChartTooltip.test.tsx | 10 +-
.../__snapshots__/ChartTooltip.test.tsx.snap | 8 +-
.../ChartVoronoContainer.test.tsx | 8 +-
.../ChartVoronoContainer.test.tsx.snap | 12 +-
.../CodeEditor/__test__/CodeEditor.test.tsx | 8 +-
.../__snapshots__/CodeEditor.test.tsx.snap | 8 +-
.../__tests__/AccessConsoles.test.tsx | 1 -
.../__tests__/DesktopViewer.test.tsx | 5 +-
.../__snapshots__/DesktopViewer.test.tsx.snap | 118 ++-
.../__tests__/SerialConsoleActions.test.tsx | 15 +-
.../SerialConsoleActions.test.tsx.snap | 45 +-
.../VncConsole/__tests__/VncConsole.test.tsx | 4 +-
.../__snapshots__/VncConsole.test.tsx.snap | 4 +-
.../AboutModal/__tests__/AboutModal.test.tsx | 4 +-
.../__tests__/AboutModalBox.test.tsx | 4 +-
.../__tests__/AboutModalBoxBrand.test.tsx | 4 +-
.../AboutModalBoxCloseButton.test.tsx | 12 +-
.../__tests__/AboutModalBoxContent.test.tsx | 4 +-
.../__tests__/AboutModalBoxHeader.test.tsx | 4 +-
.../__tests__/AboutModalBoxHero.test.tsx | 4 +-
.../__tests__/AboutModalContainer.test.tsx | 16 +-
.../__snapshots__/AboutModalBox.test.tsx.snap | 4 +-
.../AboutModalBoxBrand.test.tsx.snap | 4 +-
.../AboutModalBoxCloseButton.test.tsx.snap | 12 +-
.../AboutModalBoxContent.test.tsx.snap | 4 +-
.../AboutModalBoxHeader.test.tsx.snap | 4 +-
.../AboutModalBoxHero.test.tsx.snap | 4 +-
.../AboutModalContainer.test.tsx.snap | 12 +-
.../Accordion/__tests__/Accordion.test.tsx | 33 +-
.../Generated/AccordionContent.test.tsx | 4 +-
.../Generated/AccordionItem.test.tsx | 4 +-
.../Generated/AccordionToggle.test.tsx | 4 +-
.../AccordionContent.test.tsx.snap | 4 +-
.../__snapshots__/AccordionItem.test.tsx.snap | 4 +-
.../AccordionToggle.test.tsx.snap | 4 +-
.../__snapshots__/Accordion.test.tsx.snap | 20 +-
.../ActionList/__tests__/ActionList.test.tsx | 8 +-
.../__tests__/ActionListGroup.test.tsx | 4 +-
.../__tests__/ActionListItem.test.tsx | 4 +-
.../__snapshots__/ActionList.test.tsx.snap | 8 +-
.../ActionListGroup.test.tsx.snap | 4 +-
.../ActionListItem.test.tsx.snap | 4 +-
.../components/Alert/__tests__/Alert.test.tsx | 55 +-
.../Generated/AlertActionCloseButton.test.tsx | 4 +-
.../Generated/AlertActionLink.test.tsx | 4 +-
.../__tests__/Generated/AlertIcon.test.tsx | 4 +-
.../AlertActionCloseButton.test.tsx.snap | 4 +-
.../AlertActionLink.test.tsx.snap | 4 +-
.../__snapshots__/AlertIcon.test.tsx.snap | 4 +-
.../__snapshots__/Alert.test.tsx.snap | 210 +++--
.../AlertGroup/__tests__/AlertGroup.test.tsx | 13 +-
.../__tests__/Generated/AlertGroup.test.tsx | 4 +-
.../Generated/AlertGroupInline.test.tsx | 4 +-
.../__snapshots__/AlertGroup.test.tsx.snap | 2 +-
.../AlertGroupInline.test.tsx.snap | 4 +-
.../__snapshots__/AlertGroup.test.tsx.snap | 4 +-
.../__tests__/ApplicationLauncher.test.tsx | 30 +-
.../ApplicationLauncherContent.test.tsx | 4 +-
.../ApplicationLauncherGroup.test.tsx | 4 +-
.../ApplicationLauncherIcon.test.tsx | 4 +-
.../ApplicationLauncherSeparator.test.tsx | 4 +-
.../ApplicationLauncherText.test.tsx | 4 +-
.../ApplicationLauncherContent.test.tsx.snap | 4 +-
.../ApplicationLauncherGroup.test.tsx.snap | 5 +-
.../ApplicationLauncherIcon.test.tsx.snap | 4 +-
...ApplicationLauncherSeparator.test.tsx.snap | 4 +-
.../ApplicationLauncherText.test.tsx.snap | 4 +-
.../ApplicationLauncher.test.tsx.snap | 24 +-
.../Avatar/__tests__/Avatar.test.tsx | 4 +-
.../__snapshots__/Avatar.test.tsx.snap | 4 +-
.../BackToTop/__tests__/BackToTop.test.tsx | 14 +-
.../__snapshots__/BackToTop.test.tsx.snap | 12 +-
.../Backdrop/__tests__/Backdrop.test.tsx | 4 +-
.../__snapshots__/Backdrop.test.tsx.snap | 4 +-
.../__tests__/BackgroundImage.test.tsx | 18 +-
.../BackgroundImage.test.tsx.snap | 8 +-
.../components/Badge/__tests__/Badge.test.tsx | 4 +-
.../__snapshots__/Badge.test.tsx.snap | 14 +-
.../Banner/__tests__/Banner.test.tsx | 26 +-
.../__snapshots__/Banner.test.tsx.snap | 39 +-
.../components/Brand/__tests__/Brand.test.tsx | 9 +-
.../__snapshots__/Brand.test.tsx.snap | 4 +-
.../Breadcrumb/__tests__/Breadcrumb.test.tsx | 16 +-
.../__tests__/BreadcrumbHeading.test.tsx | 20 +-
.../__tests__/BreadcrumbItem.test.tsx | 34 +-
.../__snapshots__/Breadcrumb.test.tsx.snap | 16 +-
.../BreadcrumbHeading.test.tsx.snap | 20 +-
.../BreadcrumbItem.test.tsx.snap | 32 +-
.../Button/__tests__/Button.test.tsx | 59 +-
.../__snapshots__/Button.test.tsx.snap | 108 ++-
.../components/Card/__tests__/Card.test.tsx | 51 +-
.../Card/__tests__/CardBody.test.tsx | 13 +-
.../__tests__/CardExpandableContent.test.tsx | 4 +-
.../Card/__tests__/CardFooter.test.tsx | 9 +-
.../Card/__tests__/CardHeadMain.test.tsx | 9 +-
.../Card/__tests__/CardHeader.test.tsx | 4 +-
.../Card/__tests__/CardHeaderMain.test.tsx | 9 +-
.../Card/__tests__/CardTitle.test.tsx | 9 +-
.../__tests__/Generated/CardActions.test.tsx | 4 +-
.../__snapshots__/CardActions.test.tsx.snap | 4 +-
.../__snapshots__/Card.test.tsx.snap | 28 +-
.../__snapshots__/CardBody.test.tsx.snap | 8 +-
.../CardExpandableContent.test.tsx.snap | 4 +-
.../__snapshots__/CardFooter.test.tsx.snap | 4 +-
.../__snapshots__/CardHeadMain.test.tsx.snap | 10 +-
.../__snapshots__/CardHeader.test.tsx.snap | 4 +-
.../CardHeaderMain.test.tsx.snap | 10 +-
.../__snapshots__/CardTitle.test.tsx.snap | 10 +-
.../Checkbox/__tests__/Checkbox.test.tsx | 45 +-
.../__snapshots__/Checkbox.test.tsx.snap | 213 ++++-
.../components/Chip/__tests__/Chip.test.tsx | 18 +-
.../__snapshots__/Chip.test.tsx.snap | 16 +-
.../ChipGroup/__tests__/ChipGroup.test.tsx | 17 +-
.../__snapshots__/ChipGroup.test.tsx.snap | 17 +-
.../__tests__/ClipboardCopyButton.test.tsx | 9 +-
.../__tests__/ClipboardCopyExpanded.test.tsx | 8 +-
.../__tests__/ClipboardCopyToggle.test.tsx | 12 +-
.../Generated/ClipboardCopy.test.tsx | 4 +-
.../__snapshots__/ClipboardCopy.test.tsx.snap | 4 +-
.../ClipboardCopyButton.test.tsx.snap | 4 +-
.../ClipboardCopyExpanded.test.tsx.snap | 8 +-
.../ClipboardCopyToggle.test.tsx.snap | 4 +-
.../CodeBlock/__tests__/CodeBlock.test.tsx | 16 +-
.../__snapshots__/CodeBlock.test.tsx.snap | 16 +-
.../__tests__/ContextSelector.test.tsx | 12 +-
.../__tests__/ContextSelectorFooter.test.tsx | 4 +-
.../__tests__/ContextSelectorItem.test.tsx | 10 +-
.../ContextSelectorMenuList.test.tsx | 8 +-
.../__tests__/ContextSelectorToggle.test.tsx | 32 +-
.../ContextSelector.test.tsx.snap | 180 +++-
.../ContextSelectorFooter.test.tsx.snap | 4 +-
.../ContextSelectorItem.test.tsx.snap | 8 +-
.../ContextSelectorMenuList.test.tsx.snap | 8 +-
.../ContextSelectorToggle.test.tsx.snap | 160 +++-
.../DataList/__tests__/DataList.test.tsx | 84 +-
.../Generated/DataListAction.test.tsx | 4 +-
.../__tests__/Generated/DataListCell.test.tsx | 4 +-
.../Generated/DataListCheck.test.tsx | 4 +-
.../Generated/DataListContent.test.tsx | 4 +-
.../__tests__/Generated/DataListItem.test.tsx | 4 +-
.../Generated/DataListItemCells.test.tsx | 6 +-
.../Generated/DataListItemRow.test.tsx | 4 +-
.../Generated/DataListToggle.test.tsx | 4 +-
.../DataListAction.test.tsx.snap | 4 +-
.../__snapshots__/DataListCell.test.tsx.snap | 4 +-
.../__snapshots__/DataListCheck.test.tsx.snap | 4 +-
.../DataListContent.test.tsx.snap | 4 +-
.../__snapshots__/DataListItem.test.tsx.snap | 4 +-
.../DataListItemCells.test.tsx.snap | 4 +-
.../DataListItemRow.test.tsx.snap | 4 +-
.../DataListToggle.test.tsx.snap | 4 +-
.../__snapshots__/DataList.test.tsx.snap | 86 +-
.../DatePicker/__tests__/DatePicker.test.tsx | 4 +-
.../__snapshots__/DatePicker.test.tsx.snap | 5 +-
.../__tests__/DescriptionList.test.tsx | 68 +-
.../DescriptionList.test.tsx.snap | 68 +-
.../Divider/__tests__/Divider.test.tsx | 20 +-
.../__snapshots__/Divider.test.tsx.snap | 16 +-
.../DragDrop/__tests__/DragDrop.test.tsx | 12 +-
.../__snapshots__/DragDrop.test.tsx.snap | 8 +-
.../Drawer/__tests__/Drawer.test.tsx | 24 +-
.../Generated/DrawerContent.test.tsx | 6 +-
.../Generated/DrawerPanelContent.test.tsx | 4 +-
.../__snapshots__/DrawerContent.test.tsx.snap | 100 +--
.../DrawerPanelContent.test.tsx.snap | 4 +-
.../__snapshots__/Drawer.test.tsx.snap | 32 +-
.../Dropdown/__tests__/Dropdown.test.tsx | 70 +-
.../Dropdown/__tests__/DropdownGroup.test.tsx | 4 +-
.../__tests__/DropdownToggle.test.tsx | 53 +-
.../__tests__/DropdownToggleAction.test.tsx | 16 +-
.../__tests__/DropdownToggleCheckbox.test.tsx | 32 +-
.../__tests__/Generated/DropdownItem.test.tsx | 4 +-
.../__tests__/Generated/DropdownMenu.test.tsx | 4 +-
.../Generated/DropdownSeparator.test.tsx | 4 +-
.../__tests__/Generated/KebabToggle.test.tsx | 4 +-
.../__snapshots__/DropdownItem.test.tsx.snap | 4 +-
.../__snapshots__/DropdownMenu.test.tsx.snap | 4 +-
.../DropdownSeparator.test.tsx.snap | 4 +-
.../__snapshots__/KebabToggle.test.tsx.snap | 4 +-
.../__tests__/InternalDropdownItem.test.tsx | 44 +-
.../Dropdown/__tests__/Toggle.test.tsx | 8 +-
.../__snapshots__/Dropdown.test.tsx.snap | 835 +++++++++++++++++-
.../__snapshots__/DropdownGroup.test.tsx.snap | 4 +-
.../DropdownToggle.test.tsx.snap | 219 ++++-
.../DropdownToggleAction.test.tsx.snap | 12 +-
.../DropdownToggleCheckbox.test.tsx.snap | 148 +++-
.../InternalDropdownItem.test.tsx.snap | 167 +++-
.../__snapshots__/Toggle.test.tsx.snap | 8 +-
.../__tests__/DualListSelector.test.tsx | 28 +-
.../DualListSelector.test.tsx.snap | 24 +-
.../EmptyState/__tests__/EmptyState.test.tsx | 39 +-
.../Generated/EmptyStateBody.test.tsx | 4 +-
.../Generated/EmptyStateIcon.test.tsx | 10 +-
.../Generated/EmptyStatePrimary.test.tsx | 4 +-
.../EmptyStateSecondaryActions.test.tsx | 4 +-
.../EmptyStateBody.test.tsx.snap | 4 +-
.../EmptyStateIcon.test.tsx.snap | 8 +-
.../EmptyStatePrimary.test.tsx.snap | 4 +-
.../EmptyStateSecondaryActions.test.tsx.snap | 4 +-
.../__snapshots__/EmptyState.test.tsx.snap | 140 ++-
.../__tests__/ExpandableSection.test.tsx | 35 +-
.../ExpandableSection.test.tsx.snap | 24 +-
.../FileUpload/__tests__/FileUpload.test.tsx | 4 +-
.../__tests__/FileUploadField.test.tsx | 4 +-
.../__snapshots__/FileUpload.test.tsx.snap | 4 +-
.../FileUploadField.test.tsx.snap | 4 +-
.../Form/__tests__/ActionGroup.test.tsx | 8 +-
.../components/Form/__tests__/Form.test.tsx | 12 +-
.../Form/__tests__/FormAlert.test.tsx | 6 +-
.../Form/__tests__/FormFieldGroup.test.tsx | 27 +-
.../Form/__tests__/FormGroup.test.tsx | 15 +-
.../Form/__tests__/FormHelperText.test.tsx | 17 +-
.../Form/__tests__/FormSection.test.tsx | 10 +-
.../__snapshots__/ActionGroup.test.tsx.snap | 8 +-
.../__snapshots__/Form.test.tsx.snap | 12 +-
.../__snapshots__/FormAlert.test.tsx.snap | 4 +-
.../FormFieldGroup.test.tsx.snap | 8 +-
.../FormHelperText.test.tsx.snap | 59 +-
.../__snapshots__/FormSection.test.tsx.snap | 12 +-
.../FormSelect/__tests__/FormSelect.test.tsx | 49 +-
.../Generated/FormSelectOption.test.tsx | 4 +-
.../Generated/FormSelectOptionGroup.test.tsx | 4 +-
.../FormSelectOption.test.tsx.snap | 4 +-
.../FormSelectOptionGroup.test.tsx.snap | 4 +-
.../__snapshots__/FormSelect.test.tsx.snap | 266 +++++-
.../HelperText/__tests__/HelperText.test.tsx | 26 +-
.../__snapshots__/HelperText.test.tsx.snap | 55 +-
.../components/Hint/__tests__/Hint.test.tsx | 4 +-
.../__snapshots__/Hint.test.tsx.snap | 4 +-
.../InputGroup/__tests__/InputGroup.test.tsx | 2 +-
.../__tests__/InputGroupText.test.tsx | 1 -
.../JumpLinks/__tests__/JumpLinks.test.tsx | 20 +-
.../__snapshots__/JumpLinks.test.tsx.snap | 24 +-
.../components/Label/__tests__/Label.test.tsx | 55 +-
.../__snapshots__/Label.test.tsx.snap | 468 +++++++++-
.../__tests__/Generated/ListItem.test.tsx | 4 +-
.../__snapshots__/ListItem.test.tsx.snap | 4 +-
.../components/List/__tests__/List.test.tsx | 1 -
.../__tests__/Generated/LoginFooter.test.tsx | 4 +-
.../__tests__/Generated/LoginHeader.test.tsx | 4 +-
.../__snapshots__/LoginFooter.test.tsx.snap | 4 +-
.../__snapshots__/LoginHeader.test.tsx.snap | 4 +-
.../LoginPage/__tests__/Login.test.tsx | 4 +-
.../__tests__/LoginFooterItem.test.tsx | 2 +-
.../LoginPage/__tests__/LoginForm.test.tsx | 16 +-
.../__tests__/LoginMainBody.test.tsx | 10 +-
.../__tests__/LoginMainFooter.test.tsx | 10 +-
.../LoginMainFooterBandItem.test.tsx | 2 +-
.../LoginMainFooterLinksItem.test.tsx | 14 +-
.../__tests__/LoginMainHeader.test.tsx | 16 +-
.../LoginPage/__tests__/LoginPage.test.tsx | 4 +-
.../__snapshots__/Login.test.tsx.snap | 7 +-
.../__snapshots__/LoginForm.test.tsx.snap | 408 ++++++++-
.../__snapshots__/LoginMainBody.test.tsx.snap | 18 +-
.../LoginMainFooter.test.tsx.snap | 18 +-
.../LoginMainFooterLinksItem.test.tsx.snap | 46 +-
.../LoginMainHeader.test.tsx.snap | 41 +-
.../__snapshots__/LoginPage.test.tsx.snap | 5 +-
.../Masthead/__tests__/Masthead.test.tsx | 60 +-
.../__snapshots__/Masthead.test.tsx.snap | 88 +-
.../components/Menu/__tests__/Menu.test.tsx | 2 +-
.../MenuToggle/__tests__/MenuToggle.test.tsx | 36 +-
.../__snapshots__/MenuToggle.test.tsx.snap | 36 +-
.../components/Modal/__tests__/Modal.test.tsx | 11 +-
.../Modal/__tests__/ModalBox.test.tsx | 24 +-
.../Modal/__tests__/ModalBoxBody.test.tsx | 4 +-
.../__tests__/ModalBoxDescription.test.tsx | 8 +-
.../Modal/__tests__/ModalBoxFooter.test.tsx | 6 +-
.../Modal/__tests__/ModalBoxHeader.test.tsx | 8 +-
.../Modal/__tests__/ModalBoxTitle.test.tsx | 26 +-
.../Modal/__tests__/ModalContent.test.tsx | 56 +-
.../__snapshots__/ModalBox.test.tsx.snap | 24 +-
.../__snapshots__/ModalBoxBody.test.tsx.snap | 4 +-
.../ModalBoxDescription.test.tsx.snap | 4 +-
.../ModalBoxFooter.test.tsx.snap | 4 +-
.../ModalBoxHeader.test.tsx.snap | 8 +-
.../__snapshots__/ModalBoxTitle.test.tsx.snap | 25 +-
.../__snapshots__/ModalContent.test.tsx.snap | 39 +-
.../Generated/NavExpandable.test.tsx | 6 +-
.../Nav/__tests__/Generated/NavGroup.test.tsx | 4 +-
.../Nav/__tests__/Generated/NavItem.test.tsx | 4 +-
.../Nav/__tests__/Generated/NavList.test.tsx | 4 +-
.../__snapshots__/NavExpandable.test.tsx.snap | 4 +-
.../__snapshots__/NavGroup.test.tsx.snap | 4 +-
.../__snapshots__/NavItem.test.tsx.snap | 4 +-
.../__snapshots__/NavList.test.tsx.snap | 4 +-
.../src/components/Nav/__tests__/Nav.test.tsx | 2 +-
.../__tests__/NotificationBadge.test.tsx | 16 +-
.../NotificationBadge.test.tsx.snap | 26 +-
.../__tests__/NotificationDrawer.test.tsx | 2 +-
.../__tests__/NotificationDrawerBody.test.tsx | 2 +-
.../NotificationDrawerGroup.test.tsx | 16 +-
.../NotificationDrawerGroupList.test.tsx | 2 +-
.../NotificationDrawerHeader.test.tsx | 2 +-
.../__tests__/NotificationDrawerList.test.tsx | 2 +-
.../NotificationDrawerListItem.test.tsx | 2 +-
.../NotificationDrawerListItemBody.test.tsx | 2 +-
.../NotificationDrawerListItemHeader.test.tsx | 14 +-
.../__tests__/NumberInput.test.tsx | 40 +-
.../__snapshots__/NumberInput.test.tsx.snap | 40 +-
.../Generated/OptionsMenuItem.test.tsx | 4 +-
.../Generated/OptionsMenuItemGroup.test.tsx | 6 +-
.../Generated/OptionsMenuSeparator.test.tsx | 4 +-
.../Generated/OptionsMenuToggle.test.tsx | 6 +-
.../OptionsMenuToggleWithText.test.tsx | 8 +-
.../OptionsMenuItem.test.tsx.snap | 4 +-
.../OptionsMenuItemGroup.test.tsx.snap | 8 +-
.../OptionsMenuSeparator.test.tsx.snap | 4 +-
.../OptionsMenuToggle.test.tsx.snap | 4 +-
.../OptionsMenuToggleWithText.test.tsx.snap | 4 +-
.../__tests__/OptionsMenu.test.tsx | 32 +-
.../__snapshots__/OptionsMenu.test.tsx.snap | 32 +-
.../Generated/OverflowMenuControl.test.tsx | 6 +-
.../OverflowMenuDropdownItem.test.tsx | 4 +-
.../OverflowMenuControl.test.tsx.snap | 8 +-
.../OverflowMenuDropdownItem.test.tsx.snap | 4 +-
.../__tests__/OverflowMenu.test.tsx | 5 +-
.../__tests__/OverflowMenuControl.test.tsx | 1 -
.../__tests__/OverflowMenuGroup.test.tsx | 1 -
.../__tests__/OverflowMenuItem.test.tsx | 1 -
.../Generated/PageHeaderTools.test.tsx | 4 +-
.../Generated/PageHeaderToolsGroup.test.tsx | 6 +-
.../Generated/PageHeaderToolsItem.test.tsx | 4 +-
.../__tests__/Generated/PageSidebar.test.tsx | 4 +-
.../PageHeaderTools.test.tsx.snap | 4 +-
.../PageHeaderToolsGroup.test.tsx.snap | 4 +-
.../PageHeaderToolsItem.test.tsx.snap | 4 +-
.../__snapshots__/PageSidebar.test.tsx.snap | 4 +-
.../components/Page/__tests__/Page.test.tsx | 1 -
.../Page/__tests__/PageBreadcrumb.test.tsx | 28 +-
.../Page/__tests__/PageGroup.test.tsx | 24 +-
.../Page/__tests__/PageHeader.test.tsx | 4 +-
.../Page/__tests__/PageNavigation.test.tsx | 28 +-
.../Page/__tests__/PageSection.test.tsx | 60 +-
.../PageBreadcrumb.test.tsx.snap | 28 +-
.../__snapshots__/PageGroup.test.tsx.snap | 24 +-
.../__snapshots__/PageHeader.test.tsx.snap | 4 +-
.../PageNavigation.test.tsx.snap | 28 +-
.../__snapshots__/PageSection.test.tsx.snap | 60 +-
.../__tests__/Generated/Navigation.test.tsx | 4 +-
.../Generated/OptionsToggle.test.tsx | 4 +-
.../Generated/PaginationOptionsMenu.test.tsx | 4 +-
.../Generated/ToggleTemplate.test.tsx | 4 +-
.../__snapshots__/Navigation.test.tsx.snap | 4 +-
.../__snapshots__/OptionsToggle.test.tsx.snap | 4 +-
.../PaginationOptionsMenu.test.tsx.snap | 4 +-
.../ToggleTemplate.test.tsx.snap | 15 +-
.../Pagination/__tests__/Pagination.test.tsx | 1 -
.../components/Panel/__tests__/Panel.test.tsx | 36 +-
.../__snapshots__/Panel.test.tsx.snap | 36 +-
.../__tests__/Generated/PopoverArrow.test.tsx | 4 +-
.../__tests__/Generated/PopoverBody.test.tsx | 4 +-
.../Generated/PopoverCloseButton.test.tsx | 4 +-
.../Generated/PopoverContent.test.tsx | 4 +-
.../Generated/PopoverDialog.test.tsx | 4 +-
.../Generated/PopoverFooter.test.tsx | 4 +-
.../Generated/PopoverHeader.test.tsx | 4 +-
.../__snapshots__/PopoverArrow.test.tsx.snap | 4 +-
.../__snapshots__/PopoverBody.test.tsx.snap | 4 +-
.../PopoverCloseButton.test.tsx.snap | 4 +-
.../PopoverContent.test.tsx.snap | 4 +-
.../__snapshots__/PopoverDialog.test.tsx.snap | 4 +-
.../__snapshots__/PopoverFooter.test.tsx.snap | 4 +-
.../__snapshots__/PopoverHeader.test.tsx.snap | 4 +-
.../Popover/__tests__/Popover.test.tsx | 16 +-
.../__snapshots__/Popover.test.tsx.snap | 16 +-
.../__tests__/Generated/ProgressBar.test.tsx | 4 +-
.../Generated/ProgressContainer.test.tsx | 5 +-
.../__snapshots__/ProgressBar.test.tsx.snap | 4 +-
.../ProgressContainer.test.tsx.snap | 4 +-
.../Progress/__tests__/Progress.test.tsx | 54 +-
.../__snapshots__/Progress.test.tsx.snap | 80 +-
.../__tests__/ProgressStepper.test.tsx | 48 +-
.../ProgressStepper.test.tsx.snap | 86 +-
.../components/Radio/__tests__/Radio.test.tsx | 27 +-
.../__tests__/SearchInput.test.tsx | 11 +-
.../Select/__tests__/Select.test.tsx | 3 +-
.../Select/__tests__/SelectGroup.test.tsx | 15 +-
.../Select/__tests__/SelectOption.test.tsx | 143 ++-
.../__snapshots__/SelectGroup.test.tsx.snap | 24 +-
.../__snapshots__/SelectOption.test.tsx.snap | 233 ++++-
.../Generated/SimpleListGroup.test.tsx | 4 +-
.../Generated/SimpleListItem.test.tsx | 4 +-
.../SimpleListGroup.test.tsx.snap | 4 +-
.../SimpleListItem.test.tsx.snap | 4 +-
.../SimpleList/__tests__/SimpleList.test.tsx | 5 +-
.../Skeleton/__tests__/Skeleton.test.tsx | 26 +-
.../__snapshots__/Skeleton.test.tsx.snap | 84 +-
.../__tests__/SkipToContent.test.tsx | 8 +-
.../__snapshots__/SkipToContent.test.tsx.snap | 8 +-
.../components/Slider/_tests_/Slider.test.tsx | 40 +-
.../__snapshots__/Slider.test.tsx.snap | 42 +-
.../Spinner/__tests__/Spinner.test.tsx | 20 +-
.../__snapshots__/Spinner.test.tsx.snap | 20 +-
.../Switch/__tests__/Switch.test.tsx | 27 +-
.../__tests__/Generated/TabContent.test.tsx | 4 +-
.../__snapshots__/TabContent.test.tsx.snap | 4 +-
.../components/Tabs/__tests__/Tab.test.tsx | 6 +-
.../Tabs/__tests__/TabButton.test.tsx | 4 +-
.../components/Tabs/__tests__/Tabs.test.tsx | 141 ++-
.../__tests__/__snapshots__/Tab.test.tsx.snap | 4 +-
.../__snapshots__/TabButton.test.tsx.snap | 4 +-
.../__snapshots__/Tabs.test.tsx.snap | 58 +-
.../__tests__/Generated/TextContent.test.tsx | 4 +-
.../__tests__/Generated/TextList.test.tsx | 4 +-
.../__tests__/Generated/TextListItem.test.tsx | 4 +-
.../__snapshots__/TextContent.test.tsx.snap | 4 +-
.../__snapshots__/TextList.test.tsx.snap | 4 +-
.../__snapshots__/TextListItem.test.tsx.snap | 4 +-
.../components/Text/__tests__/Text.test.tsx | 4 +-
.../__snapshots__/Text.test.tsx.snap | 7 +-
.../TextArea/__tests__/TextArea.test.tsx | 17 +-
.../TextInput/__tests__/TextInput.test.tsx | 19 +-
.../components/Tile/__tests__/Tile.test.tsx | 28 +-
.../__snapshots__/Tile.test.tsx.snap | 28 +-
.../TimePicker/__tests__/TimePicker.test.tsx | 15 +-
.../components/Title/__tests__/Title.test.tsx | 3 -
.../__tests__/ToggleGroup.test.tsx | 16 +-
.../__tests__/ToggleGroupItemElement.test.tsx | 16 +-
.../ToggleGroupItemElement.test.tsx.snap | 12 +-
.../ToolbarChipGroupContent.test.tsx | 4 +-
.../Generated/ToolbarContent.test.tsx | 4 +-
.../ToolbarExpandableContent.test.tsx | 4 +-
.../__tests__/Generated/ToolbarGroup.test.tsx | 4 +-
.../ToolbarChipGroupContent.test.tsx.snap | 4 +-
.../ToolbarContent.test.tsx.snap | 4 +-
.../ToolbarExpandableContent.test.tsx.snap | 4 +-
.../__snapshots__/ToolbarGroup.test.tsx.snap | 4 +-
.../Toolbar/__tests__/Toolbar.test.tsx | 12 +-
.../Toolbar/__tests__/ToolbarItem.test.tsx | 6 +-
.../__tests__/ToolbarToggleGroup.test.tsx | 2 +-
.../__snapshots__/Toolbar.test.tsx.snap | 507 ++++++++++-
.../__snapshots__/ToolbarItem.test.tsx.snap | 11 +-
.../__tests__/Generated/TooltipArrow.test.tsx | 4 +-
.../Generated/TooltipContent.test.tsx | 6 +-
.../__snapshots__/TooltipArrow.test.tsx.snap | 4 +-
.../TooltipContent.test.tsx.snap | 4 +-
.../Tooltip/__tests__/Tooltip.test.tsx | 4 +-
.../__snapshots__/Tooltip.test.tsx.snap | 4 +-
.../TreeView/__tests__/TreeView.test.tsx | 80 +-
.../__snapshots__/TreeView.test.tsx.snap | 44 +-
.../Truncate/__tests__/Truncate.test.tsx | 24 +-
.../__snapshots__/Truncate.test.tsx.snap | 15 +-
.../__tests__/Generated/WizardBody.test.tsx | 4 +-
.../__tests__/Generated/WizardFooter.test.tsx | 4 +-
.../Generated/WizardFooterInternal.test.tsx | 6 +-
.../__tests__/Generated/WizardHeader.test.tsx | 4 +-
.../__tests__/Generated/WizardNav.test.tsx | 4 +-
.../Generated/WizardNavItem.test.tsx | 4 +-
.../__tests__/Generated/WizardToggle.test.tsx | 8 +-
.../__snapshots__/WizardBody.test.tsx.snap | 4 +-
.../__snapshots__/WizardFooter.test.tsx.snap | 4 +-
.../WizardFooterInternal.test.tsx.snap | 4 +-
.../__snapshots__/WizardHeader.test.tsx.snap | 14 +-
.../__snapshots__/WizardNav.test.tsx.snap | 4 +-
.../__snapshots__/WizardNavItem.test.tsx.snap | 4 +-
.../__snapshots__/WizardToggle.test.tsx.snap | 4 +-
.../Wizard/__tests__/Wizard.test.tsx | 3 -
.../__tests__/Generated/FocusTrap.test.tsx | 4 +-
.../__snapshots__/FocusTrap.test.tsx.snap | 4 +-
.../GenerateId/__tests__/GenerateId.test.tsx | 4 +-
.../__snapshots__/GenerateId.test.tsx.snap | 4 +-
.../Generated/FindRefWrapper.test.tsx | 4 +-
.../FindRefWrapper.test.tsx.snap | 4 +-
.../src/helpers/__tests__/util.test.ts | 4 +-
.../Bullseye/__tests__/Bullseye.test.tsx | 5 +-
.../src/layouts/Flex/__tests__/Flex.test.tsx | 1 -
.../__tests__/Generated/FlexItem.test.tsx | 4 +-
.../__snapshots__/FlexItem.test.tsx.snap | 4 +-
.../Gallery/__tests__/Gallery.test.tsx | 16 +-
.../__tests__/Generated/GalleryItem.test.tsx | 4 +-
.../__snapshots__/GalleryItem.test.tsx.snap | 4 +-
.../__snapshots__/Gallery.test.tsx.snap | 12 +-
.../src/layouts/Grid/__tests__/Grid.test.tsx | 12 +-
.../layouts/Grid/__tests__/GridItem.test.tsx | 24 +-
.../__snapshots__/Grid.test.tsx.snap | 8 +-
.../__snapshots__/GridItem.test.tsx.snap | 72 +-
.../__tests__/Generated/LevelItem.test.tsx | 4 +-
.../__snapshots__/LevelItem.test.tsx.snap | 4 +-
.../layouts/Level/__tests__/Level.test.tsx | 8 +-
.../__snapshots__/Level.test.tsx.snap | 8 +-
.../__tests__/Generated/SplitItem.test.tsx | 4 +-
.../__snapshots__/SplitItem.test.tsx.snap | 4 +-
.../layouts/Split/__tests__/Split.test.tsx | 16 +-
.../__snapshots__/Split.test.tsx.snap | 16 +-
.../__tests__/Generated/StackItem.test.tsx | 4 +-
.../__snapshots__/StackItem.test.tsx.snap | 4 +-
.../layouts/Stack/__tests__/Stack.test.tsx | 12 +-
.../__snapshots__/Stack.test.tsx.snap | 12 +-
.../src/__tests__/createIcon.test.tsx | 15 +-
.../ConfirmButtons/ConfirmButtons.test.js | 4 +-
.../__snapshots__/ConfirmButtons.test.js.snap | 4 +-
.../TableTextInput/TableTextInput.test.js | 8 +-
.../__snapshots__/TableTextInput.test.js.snap | 8 +-
.../components/Table/__tests__/Table.test.tsx | 3 +-
.../Table/utils/transformers.test.tsx | 1 -
.../__tests__/TopologySideBar.test.tsx | 1 -
.../ComputeElementDimensions.test.tsx | 3 +-
.../Virtualized/VirtualizedTable.test.tsx | 24 +-
.../VirtualizedTable.test.tsx.snap | 25 +-
packages/testSetup.ts | 2 +
.../patternfly-4-component/index.js | 6 -
.../component/component.test.tsx.hbs | 8 -
573 files changed, 7797 insertions(+), 3711 deletions(-)
create mode 100644 packages/testSetup.ts
delete mode 100644 scripts/generators/patternfly-4-component/templates/component/component.test.tsx.hbs
diff --git a/jest.config.js b/jest.config.js
index 5384a346758..4e28a21b5ff 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -12,6 +12,7 @@ module.exports = {
transform: {
'^.+\\.[jt]sx?$': 'babel-jest'
},
+ setupFilesAfterEnv: ['/packages/testSetup.ts'],
transformIgnorePatterns: ['node_modules/(?!@patternfly|@novnc|@popperjs|lodash|monaco-editor|react-monaco-editor)'],
testPathIgnorePatterns: ['/packages/react-integration/'],
coveragePathIgnorePatterns: ['/dist/'],
diff --git a/packages/react-catalog-view-extension/src/components/CatalogItemHeader/CatalogItemHeader.test.tsx b/packages/react-catalog-view-extension/src/components/CatalogItemHeader/CatalogItemHeader.test.tsx
index 90e3a3e2f31..d361ce50c3a 100644
--- a/packages/react-catalog-view-extension/src/components/CatalogItemHeader/CatalogItemHeader.test.tsx
+++ b/packages/react-catalog-view-extension/src/components/CatalogItemHeader/CatalogItemHeader.test.tsx
@@ -3,7 +3,7 @@ import React from 'react';
import { render } from '@testing-library/react';
test('simple catalog item header', () => {
- const view = render(
+ const { asFragment } = render(
{
}
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-catalog-view-extension/src/components/CatalogItemHeader/__snapshots__/CatalogItemHeader.test.tsx.snap b/packages/react-catalog-view-extension/src/components/CatalogItemHeader/__snapshots__/CatalogItemHeader.test.tsx.snap
index bdf0c97855b..d79670ec7df 100644
--- a/packages/react-catalog-view-extension/src/components/CatalogItemHeader/__snapshots__/CatalogItemHeader.test.tsx.snap
+++ b/packages/react-catalog-view-extension/src/components/CatalogItemHeader/__snapshots__/CatalogItemHeader.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`simple catalog item header 1`] = `
-
+
-
+
`;
diff --git a/packages/react-catalog-view-extension/src/components/CatalogTile/CatalogTile.test.tsx b/packages/react-catalog-view-extension/src/components/CatalogTile/CatalogTile.test.tsx
index dd7d34d8e5e..97fed602682 100644
--- a/packages/react-catalog-view-extension/src/components/CatalogTile/CatalogTile.test.tsx
+++ b/packages/react-catalog-view-extension/src/components/CatalogTile/CatalogTile.test.tsx
@@ -1,9 +1,10 @@
import * as React from 'react';
-import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
-import OutlinedCheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/outlined-check-circle-icon';
+
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
+import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
+import OutlinedCheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/outlined-check-circle-icon';
import { CatalogTile } from './CatalogTile';
import { CatalogTileBadge } from './CatalogTileBadge';
@@ -90,7 +91,7 @@ test('CatalogTile renders properly', () => {
});
test('CatalogTile href renders properly', () => {
- const view = render(
+ const { asFragment } = render(
{
description="1234567890123"
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('CatalogTile onClick behaves properly', () => {
@@ -119,5 +120,5 @@ test('CatalogTile onClick behaves properly', () => {
);
userEvent.click(screen.getByText('Patternfly'));
- expect(onClickMock).toBeCalled();
+ expect(onClickMock).toHaveBeenCalled();
});
diff --git a/packages/react-catalog-view-extension/src/components/CatalogTile/__snapshots__/CatalogTile.test.tsx.snap b/packages/react-catalog-view-extension/src/components/CatalogTile/__snapshots__/CatalogTile.test.tsx.snap
index 220aff35688..6306e06ad6c 100644
--- a/packages/react-catalog-view-extension/src/components/CatalogTile/__snapshots__/CatalogTile.test.tsx.snap
+++ b/packages/react-catalog-view-extension/src/components/CatalogTile/__snapshots__/CatalogTile.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`CatalogTile href renders properly 1`] = `
-
-
+
`;
exports[`CatalogTile renders properly 1`] = `
diff --git a/packages/react-catalog-view-extension/src/components/VerticalTabs/VerticalTabs.test.tsx b/packages/react-catalog-view-extension/src/components/VerticalTabs/VerticalTabs.test.tsx
index e182d255cb4..4a2d6f94661 100644
--- a/packages/react-catalog-view-extension/src/components/VerticalTabs/VerticalTabs.test.tsx
+++ b/packages/react-catalog-view-extension/src/components/VerticalTabs/VerticalTabs.test.tsx
@@ -1,4 +1,5 @@
import React from 'react';
+
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
@@ -90,7 +91,7 @@ test('Vertical Tabs Tab onActivate is called correctly', () => {
userEvent.click(screen.getByText('Click Me'));
expect(component.container).toMatchSnapshot();
- expect(onActivateMock).toBeCalled();
+ expect(onActivateMock).toHaveBeenCalled();
});
test('Vertical Tabs Tab wrap styling is set correctly', () => {
diff --git a/packages/react-charts/src/components/Chart/Chart.test.tsx b/packages/react-charts/src/components/Chart/Chart.test.tsx
index 83d360793a3..88432f4384d 100644
--- a/packages/react-charts/src/components/Chart/Chart.test.tsx
+++ b/packages/react-charts/src/components/Chart/Chart.test.tsx
@@ -6,13 +6,13 @@ import { ChartLine } from '../ChartLine';
Object.values([true, false]).forEach(() => {
test('Chart', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders axis and component children', () => {
- const view = render(
+ const { asFragment } = render(
{
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/Chart/__snapshots__/Chart.test.tsx.snap b/packages/react-charts/src/components/Chart/__snapshots__/Chart.test.tsx.snap
index 8c19b5e3025..71da8d15841 100644
--- a/packages/react-charts/src/components/Chart/__snapshots__/Chart.test.tsx.snap
+++ b/packages/react-charts/src/components/Chart/__snapshots__/Chart.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Chart 1`] = `
-
-
+
`;
exports[`Chart 2`] = `
-
-
+
`;
exports[`renders axis and component children 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartArea/ChartArea.test.tsx b/packages/react-charts/src/components/ChartArea/ChartArea.test.tsx
index 6eabe19cb34..972e37ba4ca 100644
--- a/packages/react-charts/src/components/ChartArea/ChartArea.test.tsx
+++ b/packages/react-charts/src/components/ChartArea/ChartArea.test.tsx
@@ -4,13 +4,13 @@ import { ChartArea } from '../ChartArea';
Object.values([true, false]).forEach(() => {
test('ChartArea', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
{
]}
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartArea/__snapshots__/ChartArea.test.tsx.snap b/packages/react-charts/src/components/ChartArea/__snapshots__/ChartArea.test.tsx.snap
index 3990c06f09b..4611b706ec7 100644
--- a/packages/react-charts/src/components/ChartArea/__snapshots__/ChartArea.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartArea/__snapshots__/ChartArea.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartArea 1`] = `
-
-
+
`;
exports[`ChartArea 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartAxis/ChartAxis.test.tsx b/packages/react-charts/src/components/ChartAxis/ChartAxis.test.tsx
index da3b48cb9bc..bf8a233609a 100644
--- a/packages/react-charts/src/components/ChartAxis/ChartAxis.test.tsx
+++ b/packages/react-charts/src/components/ChartAxis/ChartAxis.test.tsx
@@ -7,13 +7,13 @@ import { ChartLine } from '../ChartLine';
Object.values([true, false]).forEach(() => {
test('ChartAxis', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
{
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartAxis/__snapshots__/ChartAxis.test.tsx.snap b/packages/react-charts/src/components/ChartAxis/__snapshots__/ChartAxis.test.tsx.snap
index 856709591a4..09230e4e047 100644
--- a/packages/react-charts/src/components/ChartAxis/__snapshots__/ChartAxis.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartAxis/__snapshots__/ChartAxis.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartAxis 1`] = `
-
-
+
`;
exports[`ChartAxis 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartBar/ChartBar.test.tsx b/packages/react-charts/src/components/ChartBar/ChartBar.test.tsx
index 20dee94a345..afed8ec5832 100644
--- a/packages/react-charts/src/components/ChartBar/ChartBar.test.tsx
+++ b/packages/react-charts/src/components/ChartBar/ChartBar.test.tsx
@@ -6,13 +6,13 @@ import { ChartGroup } from '../ChartGroup';
Object.values([true, false]).forEach(() => {
test('ChartBar', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
{
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartBar/__snapshots__/ChartBar.test.tsx.snap b/packages/react-charts/src/components/ChartBar/__snapshots__/ChartBar.test.tsx.snap
index 27475dbf02c..8530ad2bd4a 100644
--- a/packages/react-charts/src/components/ChartBar/__snapshots__/ChartBar.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartBar/__snapshots__/ChartBar.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartBar 1`] = `
-
-
+
`;
exports[`ChartBar 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartBullet/ChartBullet.test.tsx b/packages/react-charts/src/components/ChartBullet/ChartBullet.test.tsx
index 55a7a50331a..10c21a55e60 100644
--- a/packages/react-charts/src/components/ChartBullet/ChartBullet.test.tsx
+++ b/packages/react-charts/src/components/ChartBullet/ChartBullet.test.tsx
@@ -4,13 +4,13 @@ import { ChartBullet } from './ChartBullet';
Object.values([true, false]).forEach(() => {
test('ChartBulletQualitativeRange', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
{
width={450}
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartBullet/ChartBulletComparativeErrorMeasure.test.tsx b/packages/react-charts/src/components/ChartBullet/ChartBulletComparativeErrorMeasure.test.tsx
index 19f3869d93d..ee2e3468e30 100644
--- a/packages/react-charts/src/components/ChartBullet/ChartBulletComparativeErrorMeasure.test.tsx
+++ b/packages/react-charts/src/components/ChartBullet/ChartBulletComparativeErrorMeasure.test.tsx
@@ -4,12 +4,14 @@ import { ChartBulletComparativeErrorMeasure } from './ChartBulletComparativeErro
Object.values([true, false]).forEach(() => {
test('ChartBulletComparativeErrorMeasure', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(
+
+ );
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartBullet/ChartBulletComparativeMeasure.test.tsx b/packages/react-charts/src/components/ChartBullet/ChartBulletComparativeMeasure.test.tsx
index 37cae14d94c..065596c6bb9 100644
--- a/packages/react-charts/src/components/ChartBullet/ChartBulletComparativeMeasure.test.tsx
+++ b/packages/react-charts/src/components/ChartBullet/ChartBulletComparativeMeasure.test.tsx
@@ -4,12 +4,14 @@ import { ChartBulletComparativeMeasure } from './ChartBulletComparativeMeasure';
Object.values([true, false]).forEach(() => {
test('ChartBulletComparativeMeasure', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(
+
+ );
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartBullet/ChartBulletComparativeWarningMeasure.test.tsx b/packages/react-charts/src/components/ChartBullet/ChartBulletComparativeWarningMeasure.test.tsx
index 8b001002970..b1bb81c26f4 100644
--- a/packages/react-charts/src/components/ChartBullet/ChartBulletComparativeWarningMeasure.test.tsx
+++ b/packages/react-charts/src/components/ChartBullet/ChartBulletComparativeWarningMeasure.test.tsx
@@ -4,14 +4,14 @@ import { ChartBulletComparativeWarningMeasure } from './ChartBulletComparativeWa
Object.values([true, false]).forEach(() => {
test('ChartBulletComparativeZeroMeasure', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartBullet/ChartBulletGroupTitle.test.tsx b/packages/react-charts/src/components/ChartBullet/ChartBulletGroupTitle.test.tsx
index b0a8b09e051..bbae6e048e4 100644
--- a/packages/react-charts/src/components/ChartBullet/ChartBulletGroupTitle.test.tsx
+++ b/packages/react-charts/src/components/ChartBullet/ChartBulletGroupTitle.test.tsx
@@ -4,12 +4,12 @@ import { ChartBulletGroupTitle } from './ChartBulletGroupTitle';
Object.values([true, false]).forEach(() => {
test('ChartBulletGroupTitle', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartBullet/ChartBulletPrimaryDotMeasure.test.tsx b/packages/react-charts/src/components/ChartBullet/ChartBulletPrimaryDotMeasure.test.tsx
index 9055a648fe6..c795926f137 100644
--- a/packages/react-charts/src/components/ChartBullet/ChartBulletPrimaryDotMeasure.test.tsx
+++ b/packages/react-charts/src/components/ChartBullet/ChartBulletPrimaryDotMeasure.test.tsx
@@ -4,14 +4,14 @@ import { ChartBulletPrimaryDotMeasure } from './ChartBulletPrimaryDotMeasure';
Object.values([true, false]).forEach(() => {
test('ChartBulletPrimaryDotMeasure', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartBullet/ChartBulletPrimarySegmentedMeasure.test.tsx b/packages/react-charts/src/components/ChartBullet/ChartBulletPrimarySegmentedMeasure.test.tsx
index c6068abcd93..80b09370953 100644
--- a/packages/react-charts/src/components/ChartBullet/ChartBulletPrimarySegmentedMeasure.test.tsx
+++ b/packages/react-charts/src/components/ChartBullet/ChartBulletPrimarySegmentedMeasure.test.tsx
@@ -4,14 +4,14 @@ import { ChartBulletPrimarySegmentedMeasure } from './ChartBulletPrimarySegmente
Object.values([true, false]).forEach(() => {
test('ChartBulletPrimarySegmentedMeasure', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartBullet/ChartBulletQualitativeRange.test.tsx b/packages/react-charts/src/components/ChartBullet/ChartBulletQualitativeRange.test.tsx
index fb1b7982998..7eba951db01 100644
--- a/packages/react-charts/src/components/ChartBullet/ChartBulletQualitativeRange.test.tsx
+++ b/packages/react-charts/src/components/ChartBullet/ChartBulletQualitativeRange.test.tsx
@@ -4,14 +4,14 @@ import { ChartBulletQualitativeRange } from './ChartBulletQualitativeRange';
Object.values([true, false]).forEach(() => {
test('ChartBulletQualitativeRange', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartBullet/ChartBulletTitle.test.tsx b/packages/react-charts/src/components/ChartBullet/ChartBulletTitle.test.tsx
index d57ff5bcd78..2259ce4000d 100644
--- a/packages/react-charts/src/components/ChartBullet/ChartBulletTitle.test.tsx
+++ b/packages/react-charts/src/components/ChartBullet/ChartBulletTitle.test.tsx
@@ -4,12 +4,12 @@ import { ChartBulletTitle } from './ChartBulletTitle';
Object.values([true, false]).forEach(() => {
test('ChartBulletTitle', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBullet.test.tsx.snap b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBullet.test.tsx.snap
index 4badf7ccce8..3edab5a57e5 100644
--- a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBullet.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBullet.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartBulletQualitativeRange 1`] = `
-
-
+
`;
exports[`ChartBulletQualitativeRange 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletComparativeErrorMeasure.test.tsx.snap b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletComparativeErrorMeasure.test.tsx.snap
index b5b26acdad9..dc9006e634c 100644
--- a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletComparativeErrorMeasure.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletComparativeErrorMeasure.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartBulletComparativeErrorMeasure 1`] = `
-
-
+
`;
exports[`ChartBulletComparativeErrorMeasure 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletComparativeMeasure.test.tsx.snap b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletComparativeMeasure.test.tsx.snap
index 30789d28df3..a3b4ab2d0e1 100644
--- a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletComparativeMeasure.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletComparativeMeasure.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartBulletComparativeMeasure 1`] = `
-
-
+
`;
exports[`ChartBulletComparativeMeasure 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletComparativeWarningMeasure.test.tsx.snap b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletComparativeWarningMeasure.test.tsx.snap
index ab678e84965..c7add0824f8 100644
--- a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletComparativeWarningMeasure.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletComparativeWarningMeasure.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartBulletComparativeZeroMeasure 1`] = `
-
-
+
`;
exports[`ChartBulletComparativeZeroMeasure 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletGroupTitle.test.tsx.snap b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletGroupTitle.test.tsx.snap
index 2a02ee3fb94..72534609065 100644
--- a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletGroupTitle.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletGroupTitle.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartBulletGroupTitle 1`] = `
-
-
+
`;
exports[`ChartBulletGroupTitle 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletPrimaryDotMeasure.test.tsx.snap b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletPrimaryDotMeasure.test.tsx.snap
index aa88af457f4..d28365c38da 100644
--- a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletPrimaryDotMeasure.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletPrimaryDotMeasure.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartBulletPrimaryDotMeasure 1`] = `
-
-
+
`;
exports[`ChartBulletPrimaryDotMeasure 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletPrimarySegmentedMeasure.test.tsx.snap b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletPrimarySegmentedMeasure.test.tsx.snap
index 0fffa0ed46d..f7541aefacb 100644
--- a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletPrimarySegmentedMeasure.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletPrimarySegmentedMeasure.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartBulletPrimarySegmentedMeasure 1`] = `
-
-
+
`;
exports[`ChartBulletPrimarySegmentedMeasure 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletQualitativeRange.test.tsx.snap b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletQualitativeRange.test.tsx.snap
index 8c4315e2ab2..711173d4f4c 100644
--- a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletQualitativeRange.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletQualitativeRange.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartBulletQualitativeRange 1`] = `
-
-
+
`;
exports[`ChartBulletQualitativeRange 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletTitle.test.tsx.snap b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletTitle.test.tsx.snap
index fe0e2a90c6b..dd7810d0266 100644
--- a/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletTitle.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartBullet/__snapshots__/ChartBulletTitle.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartBulletTitle 1`] = `
-
-
+
`;
exports[`ChartBulletTitle 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartContainer/ChartContainer.test.tsx b/packages/react-charts/src/components/ChartContainer/ChartContainer.test.tsx
index b2b39285b60..6fbdad04ca8 100644
--- a/packages/react-charts/src/components/ChartContainer/ChartContainer.test.tsx
+++ b/packages/react-charts/src/components/ChartContainer/ChartContainer.test.tsx
@@ -5,13 +5,13 @@ import { ChartLegend } from '../ChartLegend';
Object.values([true, false]).forEach(() => {
test('ChartContainer', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders container via ChartLegend', () => {
- const view = render(
+ const { asFragment } = render(
{
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartContainer/__snapshots__/ChartContainer.test.tsx.snap b/packages/react-charts/src/components/ChartContainer/__snapshots__/ChartContainer.test.tsx.snap
index e07c160403c..dfcd7621cd5 100644
--- a/packages/react-charts/src/components/ChartContainer/__snapshots__/ChartContainer.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartContainer/__snapshots__/ChartContainer.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartContainer 1`] = `
-
-
+
`;
exports[`ChartContainer 2`] = `
-
-
+
`;
exports[`renders container via ChartLegend 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartCursorContainer/ChartCursorContainer.test.tsx b/packages/react-charts/src/components/ChartCursorContainer/ChartCursorContainer.test.tsx
index c1b94337fa0..4edeb5735a5 100644
--- a/packages/react-charts/src/components/ChartCursorContainer/ChartCursorContainer.test.tsx
+++ b/packages/react-charts/src/components/ChartCursorContainer/ChartCursorContainer.test.tsx
@@ -6,13 +6,13 @@ import { ChartCursorContainer } from './ChartCursorContainer';
Object.values([true, false]).forEach(() => {
test('ChartVoronoiContainer', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders container via ChartGroup', () => {
- const view = render(
+ const { asFragment } = render(
} height={200} width={200}>
{
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartCursorContainer/__snapshots__/ChartCursorContainer.test.tsx.snap b/packages/react-charts/src/components/ChartCursorContainer/__snapshots__/ChartCursorContainer.test.tsx.snap
index 80ce36172c8..fc11d228383 100644
--- a/packages/react-charts/src/components/ChartCursorContainer/__snapshots__/ChartCursorContainer.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartCursorContainer/__snapshots__/ChartCursorContainer.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartVoronoiContainer 1`] = `
-
-
+
`;
exports[`ChartVoronoiContainer 2`] = `
-
-
+
`;
exports[`renders container via ChartGroup 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartCursorTooltip/ChartCursorFlyout.test.tsx b/packages/react-charts/src/components/ChartCursorTooltip/ChartCursorFlyout.test.tsx
index 736974e29af..793d60d474b 100644
--- a/packages/react-charts/src/components/ChartCursorTooltip/ChartCursorFlyout.test.tsx
+++ b/packages/react-charts/src/components/ChartCursorTooltip/ChartCursorFlyout.test.tsx
@@ -8,18 +8,20 @@ import { createContainer } from '../ChartUtils';
Object.values([true, false]).forEach(() => {
test('ChartTooltip', () => {
- const view = render(} />);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(
+ } />
+ );
+ expect(asFragment()).toMatchSnapshot();
});
});
test('allows tooltip via container component', () => {
const CursorVoronoiContainer = createContainer('cursor', 'voronoi');
- const view = render(
+ const { asFragment } = render(
'y: ' + point.y}
+ labels={(point: { y: number }) => 'y: ' + point.y}
labelComponent={} />}
/>
}
@@ -45,5 +47,5 @@ test('allows tooltip via container component', () => {
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartCursorTooltip/ChartCursorTooltip.test.tsx b/packages/react-charts/src/components/ChartCursorTooltip/ChartCursorTooltip.test.tsx
index b6b8ae48d14..fa0d1d0cbce 100644
--- a/packages/react-charts/src/components/ChartCursorTooltip/ChartCursorTooltip.test.tsx
+++ b/packages/react-charts/src/components/ChartCursorTooltip/ChartCursorTooltip.test.tsx
@@ -7,17 +7,20 @@ import { createContainer } from '../ChartUtils';
Object.values([true, false]).forEach(() => {
test('ChartCursorTooltip', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('allows tooltip via container component', () => {
const CursorVoronoiContainer = createContainer('cursor', 'voronoi');
- const view = render(
+ const { asFragment } = render(
'y: ' + point.y} labelComponent={} />
+ 'y: ' + point.y}
+ labelComponent={}
+ />
}
height={200}
width={200}
@@ -41,5 +44,5 @@ test('allows tooltip via container component', () => {
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartCursorTooltip/__snapshots__/ChartCursorFlyout.test.tsx.snap b/packages/react-charts/src/components/ChartCursorTooltip/__snapshots__/ChartCursorFlyout.test.tsx.snap
index 667f8be8dc4..bffba397c22 100644
--- a/packages/react-charts/src/components/ChartCursorTooltip/__snapshots__/ChartCursorFlyout.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartCursorTooltip/__snapshots__/ChartCursorFlyout.test.tsx.snap
@@ -1,11 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`ChartTooltip 1`] = ``;
+exports[`ChartTooltip 1`] = ``;
-exports[`ChartTooltip 2`] = ``;
+exports[`ChartTooltip 2`] = ``;
exports[`allows tooltip via container component 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartCursorTooltip/__snapshots__/ChartCursorTooltip.test.tsx.snap b/packages/react-charts/src/components/ChartCursorTooltip/__snapshots__/ChartCursorTooltip.test.tsx.snap
index 5931a8596f2..adf80dfea39 100644
--- a/packages/react-charts/src/components/ChartCursorTooltip/__snapshots__/ChartCursorTooltip.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartCursorTooltip/__snapshots__/ChartCursorTooltip.test.tsx.snap
@@ -1,11 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`ChartCursorTooltip 1`] = ``;
+exports[`ChartCursorTooltip 1`] = ``;
-exports[`ChartCursorTooltip 2`] = ``;
+exports[`ChartCursorTooltip 2`] = ``;
exports[`allows tooltip via container component 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartDonut/ChartDonut.test.tsx b/packages/react-charts/src/components/ChartDonut/ChartDonut.test.tsx
index 84c116a1de8..03f4b6cbe4c 100644
--- a/packages/react-charts/src/components/ChartDonut/ChartDonut.test.tsx
+++ b/packages/react-charts/src/components/ChartDonut/ChartDonut.test.tsx
@@ -4,13 +4,13 @@ import { ChartDonut } from './ChartDonut';
Object.values([true, false]).forEach(() => {
test('ChartDonut', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
{
width={200}
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartDonut/__snapshots__/ChartDonut.test.tsx.snap b/packages/react-charts/src/components/ChartDonut/__snapshots__/ChartDonut.test.tsx.snap
index bdb6aa1af4b..9bd924a2a4e 100644
--- a/packages/react-charts/src/components/ChartDonut/__snapshots__/ChartDonut.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartDonut/__snapshots__/ChartDonut.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartDonut 1`] = `
-
-
+
`;
exports[`ChartDonut 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartDonutUtilization/ChartDonutThreshold.test.tsx b/packages/react-charts/src/components/ChartDonutUtilization/ChartDonutThreshold.test.tsx
index a1dc4b4f386..913f69b374e 100644
--- a/packages/react-charts/src/components/ChartDonutUtilization/ChartDonutThreshold.test.tsx
+++ b/packages/react-charts/src/components/ChartDonutUtilization/ChartDonutThreshold.test.tsx
@@ -4,13 +4,13 @@ import { ChartDonutThreshold } from './ChartDonutThreshold';
Object.values([true, false]).forEach(() => {
test('ChartDonutThreshold', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
{
width={200}
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartDonutUtilization/ChartDonutUtilization.test.tsx b/packages/react-charts/src/components/ChartDonutUtilization/ChartDonutUtilization.test.tsx
index 00372224013..82e564ed53c 100644
--- a/packages/react-charts/src/components/ChartDonutUtilization/ChartDonutUtilization.test.tsx
+++ b/packages/react-charts/src/components/ChartDonutUtilization/ChartDonutUtilization.test.tsx
@@ -4,12 +4,12 @@ import { ChartDonutUtilization } from './ChartDonutUtilization';
Object.values([true, false]).forEach(() => {
test('ChartDonutUtilization', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartDonutUtilization/__snapshots__/ChartDonutThreshold.test.tsx.snap b/packages/react-charts/src/components/ChartDonutUtilization/__snapshots__/ChartDonutThreshold.test.tsx.snap
index 0ea8ca9a6bc..81650b1eb5f 100644
--- a/packages/react-charts/src/components/ChartDonutUtilization/__snapshots__/ChartDonutThreshold.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartDonutUtilization/__snapshots__/ChartDonutThreshold.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartDonutThreshold 1`] = `
-
-
+
`;
exports[`ChartDonutThreshold 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartDonutUtilization/__snapshots__/ChartDonutUtilization.test.tsx.snap b/packages/react-charts/src/components/ChartDonutUtilization/__snapshots__/ChartDonutUtilization.test.tsx.snap
index 698651870fc..bcfbcb98139 100644
--- a/packages/react-charts/src/components/ChartDonutUtilization/__snapshots__/ChartDonutUtilization.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartDonutUtilization/__snapshots__/ChartDonutUtilization.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartDonutUtilization 1`] = `
-
-
+
`;
exports[`ChartDonutUtilization 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartGroup/ChartGroup.test.tsx b/packages/react-charts/src/components/ChartGroup/ChartGroup.test.tsx
index 0b0f7decc42..94b3107f887 100644
--- a/packages/react-charts/src/components/ChartGroup/ChartGroup.test.tsx
+++ b/packages/react-charts/src/components/ChartGroup/ChartGroup.test.tsx
@@ -5,13 +5,13 @@ import { ChartGroup } from './ChartGroup';
Object.values([true, false]).forEach(() => {
test('ChartGroup', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders container children', () => {
- const view = render(
+ const { asFragment } = render(
{
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartGroup/__snapshots__/ChartGroup.test.tsx.snap b/packages/react-charts/src/components/ChartGroup/__snapshots__/ChartGroup.test.tsx.snap
index 8ac7f11b85a..099d5a292ed 100644
--- a/packages/react-charts/src/components/ChartGroup/__snapshots__/ChartGroup.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartGroup/__snapshots__/ChartGroup.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartGroup 1`] = `
-
-
+
`;
exports[`ChartGroup 2`] = `
-
-
+
`;
exports[`renders container children 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartLabel/ChartLabel.test.tsx b/packages/react-charts/src/components/ChartLabel/ChartLabel.test.tsx
index 90042cd94e9..591cf5ea333 100644
--- a/packages/react-charts/src/components/ChartLabel/ChartLabel.test.tsx
+++ b/packages/react-charts/src/components/ChartLabel/ChartLabel.test.tsx
@@ -4,12 +4,12 @@ import { ChartLabel } from './ChartLabel';
Object.values([true, false]).forEach(() => {
test('ChartLabel', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component text', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartLabel/__snapshots__/ChartLabel.test.tsx.snap b/packages/react-charts/src/components/ChartLabel/__snapshots__/ChartLabel.test.tsx.snap
index 6703b6ffabf..505940e4f56 100644
--- a/packages/react-charts/src/components/ChartLabel/__snapshots__/ChartLabel.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartLabel/__snapshots__/ChartLabel.test.tsx.snap
@@ -1,11 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`ChartLabel 1`] = ``;
+exports[`ChartLabel 1`] = ``;
-exports[`ChartLabel 2`] = ``;
+exports[`ChartLabel 2`] = ``;
exports[`renders component text 1`] = `
-
+
-
+
`;
diff --git a/packages/react-charts/src/components/ChartLegend/ChartLegend.test.tsx b/packages/react-charts/src/components/ChartLegend/ChartLegend.test.tsx
index 06e9a8cbffc..bf8d1243ef0 100644
--- a/packages/react-charts/src/components/ChartLegend/ChartLegend.test.tsx
+++ b/packages/react-charts/src/components/ChartLegend/ChartLegend.test.tsx
@@ -4,14 +4,14 @@ import { ChartLegend } from './ChartLegend';
Object.values([true, false]).forEach(() => {
test('ChartLegend', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartLegend/__snapshots__/ChartLegend.test.tsx.snap b/packages/react-charts/src/components/ChartLegend/__snapshots__/ChartLegend.test.tsx.snap
index 583f07b629a..5c0c232cd4b 100644
--- a/packages/react-charts/src/components/ChartLegend/__snapshots__/ChartLegend.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartLegend/__snapshots__/ChartLegend.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartLegend 1`] = `
-
-
+
`;
exports[`ChartLegend 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltip.test.tsx b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltip.test.tsx
index f147085cc69..ade032dddc0 100644
--- a/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltip.test.tsx
+++ b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltip.test.tsx
@@ -10,8 +10,8 @@ import { ChartLegendTooltip } from './ChartLegendTooltip';
Object.values([true, false]).forEach(() => {
test('ChartLegendTooltip', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
@@ -23,14 +23,16 @@ test('allows tooltip via container component', () => {
{ name: 'Birds' },
{ name: 'Mice' }
];
- const view = render(
+ const { asFragment } = render(
`${datum.y !== null ? datum.y : 'no data'}`}
- labelComponent={ datum.x} />}
+ labels={({ datum }: { datum: { y: number } }) => `${datum.y !== null ? datum.y : 'no data'}`}
+ labelComponent={
+ datum.x} />
+ }
mouseFollowTooltips
voronoiDimension="x"
voronoiPadding={50}
@@ -93,5 +95,5 @@ test('allows tooltip via container component', () => {
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipContent.test.tsx b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipContent.test.tsx
index 56896b08ee9..480a43e19b0 100644
--- a/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipContent.test.tsx
+++ b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipContent.test.tsx
@@ -4,8 +4,8 @@ import { ChartLegendTooltipContent } from './ChartLegendTooltipContent';
Object.values([true, false]).forEach(() => {
test('ChartLegendTooltipContent', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
@@ -16,6 +16,6 @@ test('renders component text', () => {
{ name: 'Birds' },
{ name: 'Mice' }
];
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLabel.test.tsx b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLabel.test.tsx
index 6ae265c849b..9826af32eea 100644
--- a/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLabel.test.tsx
+++ b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLabel.test.tsx
@@ -4,8 +4,8 @@ import { ChartLegendTooltipLabel } from './ChartLegendTooltipLabel';
Object.values([true, false]).forEach(() => {
test('ChartLegendTooltipLabel', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
@@ -16,6 +16,6 @@ test('renders component text', () => {
{ name: 'Birds' },
{ name: 'Mice' }
];
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartLegendTooltip/__snapshots__/ChartLegendTooltip.test.tsx.snap b/packages/react-charts/src/components/ChartLegendTooltip/__snapshots__/ChartLegendTooltip.test.tsx.snap
index 4b087cbdebb..3ad3963ecf8 100644
--- a/packages/react-charts/src/components/ChartLegendTooltip/__snapshots__/ChartLegendTooltip.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartLegendTooltip/__snapshots__/ChartLegendTooltip.test.tsx.snap
@@ -1,11 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`ChartLegendTooltip 1`] = ``;
+exports[`ChartLegendTooltip 1`] = ``;
-exports[`ChartLegendTooltip 2`] = ``;
+exports[`ChartLegendTooltip 2`] = ``;
exports[`allows tooltip via container component 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartLegendTooltip/__snapshots__/ChartLegendTooltipContent.test.tsx.snap b/packages/react-charts/src/components/ChartLegendTooltip/__snapshots__/ChartLegendTooltipContent.test.tsx.snap
index 4a3f98cb872..9f9db62b2bc 100644
--- a/packages/react-charts/src/components/ChartLegendTooltip/__snapshots__/ChartLegendTooltipContent.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartLegendTooltip/__snapshots__/ChartLegendTooltipContent.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartLegendTooltipContent 1`] = `
-
+
-
+
`;
exports[`ChartLegendTooltipContent 2`] = `
-
+
-
+
`;
exports[`renders component text 1`] = `
-
+
-
+
`;
diff --git a/packages/react-charts/src/components/ChartLegendTooltip/__snapshots__/ChartLegendTooltipLabel.test.tsx.snap b/packages/react-charts/src/components/ChartLegendTooltip/__snapshots__/ChartLegendTooltipLabel.test.tsx.snap
index 86fdfc4786b..a742b97c77f 100644
--- a/packages/react-charts/src/components/ChartLegendTooltip/__snapshots__/ChartLegendTooltipLabel.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartLegendTooltip/__snapshots__/ChartLegendTooltipLabel.test.tsx.snap
@@ -1,11 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`ChartLegendTooltipLabel 1`] = ``;
+exports[`ChartLegendTooltipLabel 1`] = ``;
-exports[`ChartLegendTooltipLabel 2`] = ``;
+exports[`ChartLegendTooltipLabel 2`] = ``;
exports[`renders component text 1`] = `
-
+
-
+
`;
diff --git a/packages/react-charts/src/components/ChartLine/ChartLine.test.tsx b/packages/react-charts/src/components/ChartLine/ChartLine.test.tsx
index 7b6eacb68e5..bec331c202e 100644
--- a/packages/react-charts/src/components/ChartLine/ChartLine.test.tsx
+++ b/packages/react-charts/src/components/ChartLine/ChartLine.test.tsx
@@ -6,13 +6,13 @@ import { ChartLine } from './ChartLine';
Object.values([true, false]).forEach(() => {
test('ChartLine', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
{
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartLine/__snapshots__/ChartLine.test.tsx.snap b/packages/react-charts/src/components/ChartLine/__snapshots__/ChartLine.test.tsx.snap
index 08f74b8c0a1..32a05673086 100644
--- a/packages/react-charts/src/components/ChartLine/__snapshots__/ChartLine.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartLine/__snapshots__/ChartLine.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartLine 1`] = `
-
-
+
`;
exports[`ChartLine 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartPie/ChartPie.test.tsx b/packages/react-charts/src/components/ChartPie/ChartPie.test.tsx
index 4a88a854d42..03406cfeb54 100644
--- a/packages/react-charts/src/components/ChartPie/ChartPie.test.tsx
+++ b/packages/react-charts/src/components/ChartPie/ChartPie.test.tsx
@@ -4,13 +4,13 @@ import { ChartPie } from './ChartPie';
Object.values([true, false]).forEach(() => {
test('ChartPie', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
{
width={200}
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartPie/__snapshots__/ChartPie.test.tsx.snap b/packages/react-charts/src/components/ChartPie/__snapshots__/ChartPie.test.tsx.snap
index feb6d674d7b..7c119a80ae5 100644
--- a/packages/react-charts/src/components/ChartPie/__snapshots__/ChartPie.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartPie/__snapshots__/ChartPie.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartPie 1`] = `
-
-
+
`;
exports[`ChartPie 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartPoint/ChartPoint.test.tsx b/packages/react-charts/src/components/ChartPoint/ChartPoint.test.tsx
index 25ad77ea003..50b3c978cd9 100644
--- a/packages/react-charts/src/components/ChartPoint/ChartPoint.test.tsx
+++ b/packages/react-charts/src/components/ChartPoint/ChartPoint.test.tsx
@@ -5,13 +5,13 @@ import { ChartPoint } from './ChartPoint';
Object.values([true, false]).forEach(() => {
test('ChartPoint', () => {
- const view = render(} />);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(} />);
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
{
width={200}
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartPoint/__snapshots__/ChartPoint.test.tsx.snap b/packages/react-charts/src/components/ChartPoint/__snapshots__/ChartPoint.test.tsx.snap
index 54e63c4c3ef..6be8426422d 100644
--- a/packages/react-charts/src/components/ChartPoint/__snapshots__/ChartPoint.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartPoint/__snapshots__/ChartPoint.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartPoint 1`] = `
-
-
+
`;
exports[`ChartPoint 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartScatter/ChartScatter.test.tsx b/packages/react-charts/src/components/ChartScatter/ChartScatter.test.tsx
index 05d10e30cc8..841d25a4c67 100644
--- a/packages/react-charts/src/components/ChartScatter/ChartScatter.test.tsx
+++ b/packages/react-charts/src/components/ChartScatter/ChartScatter.test.tsx
@@ -6,13 +6,13 @@ import { ChartScatter } from './ChartScatter';
Object.values([true, false]).forEach(() => {
test('ChartScatter', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
{
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartScatter/__snapshots__/ChartScatter.test.tsx.snap b/packages/react-charts/src/components/ChartScatter/__snapshots__/ChartScatter.test.tsx.snap
index 8e08a2f02f2..513ad57c411 100644
--- a/packages/react-charts/src/components/ChartScatter/__snapshots__/ChartScatter.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartScatter/__snapshots__/ChartScatter.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartScatter 1`] = `
-
-
+
`;
exports[`ChartScatter 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartStack/ChartStack.test.tsx b/packages/react-charts/src/components/ChartStack/ChartStack.test.tsx
index 75be6401854..041e16164bc 100644
--- a/packages/react-charts/src/components/ChartStack/ChartStack.test.tsx
+++ b/packages/react-charts/src/components/ChartStack/ChartStack.test.tsx
@@ -6,13 +6,13 @@ import { ChartStack } from './ChartStack';
Object.values([true, false]).forEach(() => {
test('ChartStack', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders component data', () => {
- const view = render(
+ const { asFragment } = render(
{
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartStack/__snapshots__/ChartStack.test.tsx.snap b/packages/react-charts/src/components/ChartStack/__snapshots__/ChartStack.test.tsx.snap
index bbe559b68ca..ec362981cfd 100644
--- a/packages/react-charts/src/components/ChartStack/__snapshots__/ChartStack.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartStack/__snapshots__/ChartStack.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartStack 1`] = `
-
-
+
`;
exports[`ChartStack 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartThreshold/ChartThreshold.test.tsx b/packages/react-charts/src/components/ChartThreshold/ChartThreshold.test.tsx
index 9a2b2e807cb..bcd09f0bfe7 100644
--- a/packages/react-charts/src/components/ChartThreshold/ChartThreshold.test.tsx
+++ b/packages/react-charts/src/components/ChartThreshold/ChartThreshold.test.tsx
@@ -6,8 +6,8 @@ import { ChartThreshold } from './ChartThreshold';
Object.values([true, false]).forEach(() => {
test('ChartThreshold', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
@@ -18,12 +18,12 @@ test('renders component data', () => {
{ name: 'Birds Threshold', x: 2, y: 3 },
{ name: 'Birds Threshold', x: 5, y: 3 }
];
- const view = render(
+ const { asFragment } = render(
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartThreshold/__snapshots__/ChartThreshold.test.tsx.snap b/packages/react-charts/src/components/ChartThreshold/__snapshots__/ChartThreshold.test.tsx.snap
index 608957aca2d..2ff05a801c7 100644
--- a/packages/react-charts/src/components/ChartThreshold/__snapshots__/ChartThreshold.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartThreshold/__snapshots__/ChartThreshold.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartThreshold 1`] = `
-
-
+
`;
exports[`ChartThreshold 2`] = `
-
-
+
`;
exports[`renders component data 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartTooltip/ChartTooltip.test.tsx b/packages/react-charts/src/components/ChartTooltip/ChartTooltip.test.tsx
index 7d753205662..f5dd1195add 100644
--- a/packages/react-charts/src/components/ChartTooltip/ChartTooltip.test.tsx
+++ b/packages/react-charts/src/components/ChartTooltip/ChartTooltip.test.tsx
@@ -7,15 +7,15 @@ import { ChartTooltip } from './ChartTooltip';
Object.values([true, false]).forEach(() => {
test('ChartTooltip', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('allows tooltip via container component', () => {
- const view = render(
+ const { asFragment } = render(
'y: ' + point.y} />}
+ containerComponent={ 'y: ' + point.y} />}
height={200}
width={200}
>
@@ -38,5 +38,5 @@ test('allows tooltip via container component', () => {
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartTooltip/__snapshots__/ChartTooltip.test.tsx.snap b/packages/react-charts/src/components/ChartTooltip/__snapshots__/ChartTooltip.test.tsx.snap
index ab54202bead..0cc6eb2ccca 100644
--- a/packages/react-charts/src/components/ChartTooltip/__snapshots__/ChartTooltip.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartTooltip/__snapshots__/ChartTooltip.test.tsx.snap
@@ -1,11 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`ChartTooltip 1`] = ``;
+exports[`ChartTooltip 1`] = ``;
-exports[`ChartTooltip 2`] = ``;
+exports[`ChartTooltip 2`] = ``;
exports[`allows tooltip via container component 1`] = `
-
-
+
`;
diff --git a/packages/react-charts/src/components/ChartVoronoiContainer/ChartVoronoContainer.test.tsx b/packages/react-charts/src/components/ChartVoronoiContainer/ChartVoronoContainer.test.tsx
index 817ec8a31fa..482bfaf5594 100644
--- a/packages/react-charts/src/components/ChartVoronoiContainer/ChartVoronoContainer.test.tsx
+++ b/packages/react-charts/src/components/ChartVoronoiContainer/ChartVoronoContainer.test.tsx
@@ -6,13 +6,13 @@ import { ChartVoronoiContainer } from './ChartVoronoiContainer';
Object.values([true, false]).forEach(() => {
test('ChartVoronoiContainer', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('renders container via ChartGroup', () => {
- const view = render(
+ const { asFragment } = render(
} height={200} width={200}>
{
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-charts/src/components/ChartVoronoiContainer/__snapshots__/ChartVoronoContainer.test.tsx.snap b/packages/react-charts/src/components/ChartVoronoiContainer/__snapshots__/ChartVoronoContainer.test.tsx.snap
index 80ce36172c8..fc11d228383 100644
--- a/packages/react-charts/src/components/ChartVoronoiContainer/__snapshots__/ChartVoronoContainer.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartVoronoiContainer/__snapshots__/ChartVoronoContainer.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ChartVoronoiContainer 1`] = `
-
-
+
`;
exports[`ChartVoronoiContainer 2`] = `
-
-
+
`;
exports[`renders container via ChartGroup 1`] = `
-
-
+
`;
diff --git a/packages/react-code-editor/src/components/CodeEditor/__test__/CodeEditor.test.tsx b/packages/react-code-editor/src/components/CodeEditor/__test__/CodeEditor.test.tsx
index 5ef5014bcd0..f8927aa6e3a 100644
--- a/packages/react-code-editor/src/components/CodeEditor/__test__/CodeEditor.test.tsx
+++ b/packages/react-code-editor/src/components/CodeEditor/__test__/CodeEditor.test.tsx
@@ -8,12 +8,12 @@ describe('CodeEditor', () => {
});
test('matches snapshot without props', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('matches snapshot with all props', () => {
- const view = render(
+ const { asFragment } = render(
{
language={Language.javascript}
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
});
diff --git a/packages/react-code-editor/src/components/CodeEditor/__test__/__snapshots__/CodeEditor.test.tsx.snap b/packages/react-code-editor/src/components/CodeEditor/__test__/__snapshots__/CodeEditor.test.tsx.snap
index bc17554226f..37266ab9584 100644
--- a/packages/react-code-editor/src/components/CodeEditor/__test__/__snapshots__/CodeEditor.test.tsx.snap
+++ b/packages/react-code-editor/src/components/CodeEditor/__test__/__snapshots__/CodeEditor.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`CodeEditor matches snapshot with all props 1`] = `
-
+
@@ -342,11 +342,11 @@ exports[`CodeEditor matches snapshot with all props 1`] = `
-
+
`;
exports[`CodeEditor matches snapshot without props 1`] = `
-
+
@@ -574,5 +574,5 @@ exports[`CodeEditor matches snapshot without props 1`] = `
-
+
`;
diff --git a/packages/react-console/src/components/AccessConsoles/__tests__/AccessConsoles.test.tsx b/packages/react-console/src/components/AccessConsoles/__tests__/AccessConsoles.test.tsx
index 1290ce52c55..6207f69d4fb 100644
--- a/packages/react-console/src/components/AccessConsoles/__tests__/AccessConsoles.test.tsx
+++ b/packages/react-console/src/components/AccessConsoles/__tests__/AccessConsoles.test.tsx
@@ -2,7 +2,6 @@ import React from 'react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
-import '@testing-library/jest-dom';
import { AccessConsoles } from '../AccessConsoles';
import { SerialConsole } from '../../SerialConsole';
diff --git a/packages/react-console/src/components/DesktopViewer/__tests__/DesktopViewer.test.tsx b/packages/react-console/src/components/DesktopViewer/__tests__/DesktopViewer.test.tsx
index 7d32eade352..8c6cb469dc7 100644
--- a/packages/react-console/src/components/DesktopViewer/__tests__/DesktopViewer.test.tsx
+++ b/packages/react-console/src/components/DesktopViewer/__tests__/DesktopViewer.test.tsx
@@ -2,7 +2,6 @@ import React from 'react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
-import '@testing-library/jest-dom';
import { DesktopViewer } from '../DesktopViewer';
import { MoreInformationDefaultContent } from '../MoreInformationDefaultContent';
@@ -90,8 +89,8 @@ describe('DesktopViewer', () => {
});
test('default MoreInformationContent', () => {
- render();
- expect(screen.getByText(/Launch Remote Viewer/).outerHTML).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('default implementation of generateVVFile()', () => {
diff --git a/packages/react-console/src/components/DesktopViewer/__tests__/__snapshots__/DesktopViewer.test.tsx.snap b/packages/react-console/src/components/DesktopViewer/__tests__/__snapshots__/DesktopViewer.test.tsx.snap
index ed545b28d0c..b2f253e6077 100644
--- a/packages/react-console/src/components/DesktopViewer/__tests__/__snapshots__/DesktopViewer.test.tsx.snap
+++ b/packages/react-console/src/components/DesktopViewer/__tests__/__snapshots__/DesktopViewer.test.tsx.snap
@@ -1,6 +1,122 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`DesktopViewer default MoreInformationContent 1`] = `"Clicking \\"Launch Remote Viewer\\" will download a .vv file and launch Remote Viewer
"`;
+exports[`DesktopViewer default MoreInformationContent 1`] = `
+
+
+ Clicking "Launch Remote Viewer" will download a .vv file and launch
+
+ Remote Viewer
+
+
+
+
+ Remote Viewer
+
+ is available for most operating systems. To install it, search for it in GNOME Software or run the following:
+
+
+
+
-
+
+ RHEL, CentOS
+
+
+
-
+
+ sudo yum install virt-viewer
+
+
+
+
+
-
+
+ Fedora
+
+
+
-
+
+ sudo dnf install virt-viewer
+
+
+
+
+
-
+
+ Ubuntu, Debian
+
+
+
-
+
+ sudo apt-get install virt-viewer
+
+
+
+
+
-
+
+ Windows
+
+
+
-
+
+
+
+
+
+`;
exports[`DesktopViewer empty 1`] = `
diff --git a/packages/react-console/src/components/SerialConsole/__tests__/SerialConsoleActions.test.tsx b/packages/react-console/src/components/SerialConsole/__tests__/SerialConsoleActions.test.tsx
index 2ca5ed3a8a3..03d24179cd1 100644
--- a/packages/react-console/src/components/SerialConsole/__tests__/SerialConsoleActions.test.tsx
+++ b/packages/react-console/src/components/SerialConsole/__tests__/SerialConsoleActions.test.tsx
@@ -2,20 +2,13 @@ import React from 'react';
import { render } from '@testing-library/react';
import { SerialConsoleActions } from '../SerialConsoleActions';
-test('placeholder render test', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
-});
-
test('Render SerialConsoleActions', () => {
- const view = render(
-
- );
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('Render SerialConsoleActions with custom texts', () => {
- const view = render(
+ const { asFragment } = render(
{
textReset="My Reconnect Text"
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-console/src/components/SerialConsole/__tests__/__snapshots__/SerialConsoleActions.test.tsx.snap b/packages/react-console/src/components/SerialConsole/__tests__/__snapshots__/SerialConsoleActions.test.tsx.snap
index 6d3be72febd..0ce105d4e9d 100644
--- a/packages/react-console/src/components/SerialConsole/__tests__/__snapshots__/SerialConsoleActions.test.tsx.snap
+++ b/packages/react-console/src/components/SerialConsole/__tests__/__snapshots__/SerialConsoleActions.test.tsx.snap
@@ -1,14 +1,14 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Render SerialConsoleActions 1`] = `
-
+
`;
exports[`Render SerialConsoleActions with custom texts 1`] = `
-
-`;
-
-exports[`placeholder render test 1`] = `
-
-
-
-
-
-
+
`;
diff --git a/packages/react-console/src/components/VncConsole/__tests__/VncConsole.test.tsx b/packages/react-console/src/components/VncConsole/__tests__/VncConsole.test.tsx
index 52d5c6a07f1..cfef7c874a7 100644
--- a/packages/react-console/src/components/VncConsole/__tests__/VncConsole.test.tsx
+++ b/packages/react-console/src/components/VncConsole/__tests__/VncConsole.test.tsx
@@ -4,6 +4,6 @@ import { render } from '@testing-library/react';
import { VncConsole } from '../../VncConsole';
test('placeholder render test', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-console/src/components/VncConsole/__tests__/__snapshots__/VncConsole.test.tsx.snap b/packages/react-console/src/components/VncConsole/__tests__/__snapshots__/VncConsole.test.tsx.snap
index 2221815cb3c..2334ecb85f3 100644
--- a/packages/react-console/src/components/VncConsole/__tests__/__snapshots__/VncConsole.test.tsx.snap
+++ b/packages/react-console/src/components/VncConsole/__tests__/__snapshots__/VncConsole.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`placeholder render test 1`] = `
-
+
@@ -42,5 +42,5 @@ exports[`placeholder render test 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/AboutModal/__tests__/AboutModal.test.tsx b/packages/react-core/src/components/AboutModal/__tests__/AboutModal.test.tsx
index fe68390a106..6f03b9422b5 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/AboutModal.test.tsx
+++ b/packages/react-core/src/components/AboutModal/__tests__/AboutModal.test.tsx
@@ -19,7 +19,7 @@ describe('AboutModal', () => {
render();
userEvent.type(screen.getByRole('dialog'), '{esc}');
- expect(props.onClose).toBeCalled();
+ expect(props.onClose).toHaveBeenCalled();
});
test('does not render the modal when isOpen is not specified', () => {
@@ -48,6 +48,6 @@ describe('AboutModal', () => {
global.console = { error: myMock } as any;
render(Test About Modal);
- expect(myMock).toBeCalled();
+ expect(myMock).toHaveBeenCalled();
});
});
diff --git a/packages/react-core/src/components/AboutModal/__tests__/AboutModalBox.test.tsx b/packages/react-core/src/components/AboutModal/__tests__/AboutModalBox.test.tsx
index 7540481d510..f824409ef9d 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/AboutModalBox.test.tsx
+++ b/packages/react-core/src/components/AboutModal/__tests__/AboutModalBox.test.tsx
@@ -3,10 +3,10 @@ import { render } from '@testing-library/react';
import { AboutModalBox } from '../AboutModalBox';
test('AboutModalBox Test', () => {
- const view = render(
+ const { asFragment } = render(
This is a AboutModalBox
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxBrand.test.tsx b/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxBrand.test.tsx
index d10dc66425a..a764474aaab 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxBrand.test.tsx
+++ b/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxBrand.test.tsx
@@ -3,6 +3,6 @@ import { render } from '@testing-library/react';
import { AboutModalBoxBrand } from '../AboutModalBoxBrand';
test('test About Modal Brand', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxCloseButton.test.tsx b/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxCloseButton.test.tsx
index 7f6a82c010b..817b526a15b 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxCloseButton.test.tsx
+++ b/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxCloseButton.test.tsx
@@ -3,18 +3,18 @@ import { render } from '@testing-library/react';
import { AboutModalBoxCloseButton } from '../AboutModalBoxCloseButton';
test('AboutModalBoxCloseButton Test', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('AboutModalBoxCloseButton Test onclose', () => {
const onClose = jest.fn();
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('AboutModalBoxCloseButton Test close button aria label', () => {
const closeButtonAriaLabel = 'Klose Daylok';
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxContent.test.tsx b/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxContent.test.tsx
index cf163527829..62bf982fae7 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxContent.test.tsx
+++ b/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxContent.test.tsx
@@ -3,10 +3,10 @@ import { render } from '@testing-library/react';
import { AboutModalBoxContent } from '../AboutModalBoxContent';
test('AboutModalBoxContent Test', () => {
- const view = render(
+ const { asFragment } = render(
This is a AboutModalBoxContent
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxHeader.test.tsx b/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxHeader.test.tsx
index 042b66aa2af..5e12a89f70f 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxHeader.test.tsx
+++ b/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxHeader.test.tsx
@@ -3,10 +3,10 @@ import { render } from '@testing-library/react';
import { AboutModalBoxHeader } from '../AboutModalBoxHeader';
test('AboutModalBoxHeader Test', () => {
- const view = render(
+ const { asFragment } = render(
This is a AboutModalBox header
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxHero.test.tsx b/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxHero.test.tsx
index 4fe38a7970e..deab24d340d 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxHero.test.tsx
+++ b/packages/react-core/src/components/AboutModal/__tests__/AboutModalBoxHero.test.tsx
@@ -3,6 +3,6 @@ import { render } from '@testing-library/react';
import { AboutModalBoxHero } from '../AboutModalBoxHero';
test('test About Modal Box SHero', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/AboutModal/__tests__/AboutModalContainer.test.tsx b/packages/react-core/src/components/AboutModal/__tests__/AboutModalContainer.test.tsx
index 984ed9b1db2..a45993c9f69 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/AboutModalContainer.test.tsx
+++ b/packages/react-core/src/components/AboutModal/__tests__/AboutModalContainer.test.tsx
@@ -10,27 +10,29 @@ const props = {
brandImageAlt: 'Brand Image',
backgroundImageSrc: 'backgroundImageSrc...',
'aria-labelledby': 'ariaLablledbyId',
- 'aria-describedby': 'ariaDescribedById'
+ 'aria-describedby': 'ariaDescribedById',
+ aboutModalBoxHeaderId: 'header-id',
+ aboutModalBoxContentId: 'content-id'
};
test('About Modal Container Test simple', () => {
- const view = render(This is ModalBox content);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(This is ModalBox content);
+ expect(asFragment()).toMatchSnapshot();
});
test('About Modal Container Test isOpen', () => {
- const view = render(
+ const { asFragment } = render(
This is ModalBox content
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('About Modal Container Test with onlose', () => {
- const view = render(
+ const { asFragment } = render(
undefined} {...props}>
This is ModalBox content
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBox.test.tsx.snap b/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBox.test.tsx.snap
index 1b25f1fea3e..19df35aa60b 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBox.test.tsx.snap
+++ b/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBox.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AboutModalBox Test 1`] = `
-
+
This is a AboutModalBox
-
+
`;
diff --git a/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxBrand.test.tsx.snap b/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxBrand.test.tsx.snap
index 2ad630971bf..4cdb1989a81 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxBrand.test.tsx.snap
+++ b/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxBrand.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`test About Modal Brand 1`] = `
-
+
@@ -11,5 +11,5 @@ exports[`test About Modal Brand 1`] = `
src="testimage.."
/>
-
+
`;
diff --git a/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxCloseButton.test.tsx.snap b/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxCloseButton.test.tsx.snap
index df8a6b40ea6..5d9ec226908 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxCloseButton.test.tsx.snap
+++ b/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxCloseButton.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AboutModalBoxCloseButton Test 1`] = `
-
+
@@ -29,11 +29,11 @@ exports[`AboutModalBoxCloseButton Test 1`] = `
-
+
`;
exports[`AboutModalBoxCloseButton Test close button aria label 1`] = `
-
+
@@ -61,11 +61,11 @@ exports[`AboutModalBoxCloseButton Test close button aria label 1`] = `
-
+
`;
exports[`AboutModalBoxCloseButton Test onclose 1`] = `
-
+
@@ -93,5 +93,5 @@ exports[`AboutModalBoxCloseButton Test onclose 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxContent.test.tsx.snap b/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxContent.test.tsx.snap
index 185ba240824..913bbd382b8 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxContent.test.tsx.snap
+++ b/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxContent.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AboutModalBoxContent Test 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxHeader.test.tsx.snap b/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxHeader.test.tsx.snap
index 32348ed7e29..c3703b6f6ed 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxHeader.test.tsx.snap
+++ b/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxHeader.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AboutModalBoxHeader Test 1`] = `
-
+
-
+
`;
diff --git a/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxHero.test.tsx.snap b/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxHero.test.tsx.snap
index 790bb5cd1c3..0a304021eed 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxHero.test.tsx.snap
+++ b/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalBoxHero.test.tsx.snap
@@ -1,10 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`test About Modal Box SHero 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalContainer.test.tsx.snap b/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalContainer.test.tsx.snap
index 632cfcc6e6d..484ebe2a411 100644
--- a/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalContainer.test.tsx.snap
+++ b/packages/react-core/src/components/AboutModal/__tests__/__snapshots__/AboutModalContainer.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`About Modal Container Test isOpen 1`] = `
-
+
@@ -9,6 +9,8 @@ exports[`About Modal Container Test isOpen 1`] = `
class="pf-l-bullseye"
>
-
+
`;
-exports[`About Modal Container Test simple 1`] = `
`;
+exports[`About Modal Container Test simple 1`] = `
`;
-exports[`About Modal Container Test with onlose 1`] = `
`;
+exports[`About Modal Container Test with onlose 1`] = `
`;
diff --git a/packages/react-core/src/components/Accordion/__tests__/Accordion.test.tsx b/packages/react-core/src/components/Accordion/__tests__/Accordion.test.tsx
index 9c151100671..0416efdf08e 100644
--- a/packages/react-core/src/components/Accordion/__tests__/Accordion.test.tsx
+++ b/packages/react-core/src/components/Accordion/__tests__/Accordion.test.tsx
@@ -1,7 +1,6 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
-import '@testing-library/jest-dom';
import { Accordion } from '../Accordion';
import { AccordionToggle } from '../AccordionToggle';
@@ -11,12 +10,12 @@ import { AccordionExpandedContentBody } from '../AccordionExpandedContentBody';
describe('Accordion', () => {
test('Accordion default', () => {
- const view = render(
);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(
);
+ expect(asFragment()).toMatchSnapshot();
});
test('Accordion with non-default headingLevel', () => {
- const view = render(
+ const { asFragment } = render(
Item One
@@ -24,7 +23,7 @@ describe('Accordion', () => {
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('It should pass optional aria props', () => {
@@ -35,9 +34,9 @@ describe('Accordion', () => {
);
const button = screen.getByRole('button');
- expect(button.getAttribute('aria-label')).toEqual('Toggle details for');
- expect(button.getAttribute('aria-labelledby')).toEqual('ex-toggle2 ex-item2');
- expect(button.getAttribute('aria-expanded')).toEqual('false');
+ expect(button).toHaveAttribute('aria-label', 'Toggle details for');
+ expect(button).toHaveAttribute('aria-labelledby', 'ex-toggle2 ex-item2');
+ expect(button).toHaveAttribute('aria-expanded', 'false');
});
test('Toggle expanded', () => {
@@ -48,14 +47,14 @@ describe('Accordion', () => {
);
const button = screen.getByRole('button');
- expect(button.getAttribute('aria-expanded')).toEqual('true');
- expect(button.className).toContain('pf-m-expanded');
+ expect(button).toHaveAttribute('aria-expanded', 'true');
+ expect(button).toHaveClass('pf-m-expanded');
});
test('renders content with custom Toggle and Content containers', () => {
const container = 'a';
- const view = render(
+ const { asFragment } = render(
@@ -71,7 +70,7 @@ describe('Accordion', () => {
});
test('Accordion bordered', () => {
- const view = render(
+ const { asFragment } = render(
Item One
@@ -79,11 +78,11 @@ describe('Accordion', () => {
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('Accordion display large', () => {
- const view = render(
+ const { asFragment } = render(
Item One
@@ -91,11 +90,11 @@ describe('Accordion', () => {
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('Accordion custom content', () => {
- const view = render(
+ const { asFragment } = render(
Item One
@@ -106,6 +105,6 @@ describe('Accordion', () => {
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
});
diff --git a/packages/react-core/src/components/Accordion/__tests__/Generated/AccordionContent.test.tsx b/packages/react-core/src/components/Accordion/__tests__/Generated/AccordionContent.test.tsx
index a35f15e76e0..e89d520984c 100644
--- a/packages/react-core/src/components/Accordion/__tests__/Generated/AccordionContent.test.tsx
+++ b/packages/react-core/src/components/Accordion/__tests__/Generated/AccordionContent.test.tsx
@@ -8,7 +8,7 @@ import { AccordionContent } from '../../AccordionContent';
import {} from '../..';
it('AccordionContent should match snapshot (auto-generated)', () => {
- const view = render(
+ const { asFragment } = render(
ReactNode>}
className={"''"}
@@ -19,5 +19,5 @@ it('AccordionContent should match snapshot (auto-generated)', () => {
component={() => }
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/Accordion/__tests__/Generated/AccordionItem.test.tsx b/packages/react-core/src/components/Accordion/__tests__/Generated/AccordionItem.test.tsx
index 9e370c32c73..ba6e6f5b939 100644
--- a/packages/react-core/src/components/Accordion/__tests__/Generated/AccordionItem.test.tsx
+++ b/packages/react-core/src/components/Accordion/__tests__/Generated/AccordionItem.test.tsx
@@ -8,6 +8,6 @@ import { AccordionItem } from '../../AccordionItem';
import {} from '../..';
it('AccordionItem should match snapshot (auto-generated)', () => {
- const view = render(ReactNode>} />);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(ReactNode>} />);
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/Accordion/__tests__/Generated/AccordionToggle.test.tsx b/packages/react-core/src/components/Accordion/__tests__/Generated/AccordionToggle.test.tsx
index dea3730d1de..ee320cdd12b 100644
--- a/packages/react-core/src/components/Accordion/__tests__/Generated/AccordionToggle.test.tsx
+++ b/packages/react-core/src/components/Accordion/__tests__/Generated/AccordionToggle.test.tsx
@@ -8,7 +8,7 @@ import { AccordionToggle } from '../../AccordionToggle';
import {} from '../..';
it('AccordionToggle should match snapshot (auto-generated)', () => {
- const view = render(
+ const { asFragment } = render(
ReactNode>}
className={"''"}
@@ -17,5 +17,5 @@ it('AccordionToggle should match snapshot (auto-generated)', () => {
component={() => }
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/Accordion/__tests__/Generated/__snapshots__/AccordionContent.test.tsx.snap b/packages/react-core/src/components/Accordion/__tests__/Generated/__snapshots__/AccordionContent.test.tsx.snap
index 7891a9ee4e1..37bfce90533 100644
--- a/packages/react-core/src/components/Accordion/__tests__/Generated/__snapshots__/AccordionContent.test.tsx.snap
+++ b/packages/react-core/src/components/Accordion/__tests__/Generated/__snapshots__/AccordionContent.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AccordionContent should match snapshot (auto-generated) 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/Accordion/__tests__/Generated/__snapshots__/AccordionItem.test.tsx.snap b/packages/react-core/src/components/Accordion/__tests__/Generated/__snapshots__/AccordionItem.test.tsx.snap
index 1affeb4e2e1..6731e404674 100644
--- a/packages/react-core/src/components/Accordion/__tests__/Generated/__snapshots__/AccordionItem.test.tsx.snap
+++ b/packages/react-core/src/components/Accordion/__tests__/Generated/__snapshots__/AccordionItem.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AccordionItem should match snapshot (auto-generated) 1`] = `
-
+
ReactNode
-
+
`;
diff --git a/packages/react-core/src/components/Accordion/__tests__/Generated/__snapshots__/AccordionToggle.test.tsx.snap b/packages/react-core/src/components/Accordion/__tests__/Generated/__snapshots__/AccordionToggle.test.tsx.snap
index 68b3a392903..53562f03e49 100644
--- a/packages/react-core/src/components/Accordion/__tests__/Generated/__snapshots__/AccordionToggle.test.tsx.snap
+++ b/packages/react-core/src/components/Accordion/__tests__/Generated/__snapshots__/AccordionToggle.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AccordionToggle should match snapshot (auto-generated) 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/Accordion/__tests__/__snapshots__/Accordion.test.tsx.snap b/packages/react-core/src/components/Accordion/__tests__/__snapshots__/Accordion.test.tsx.snap
index b20d7847778..4e4121ce518 100644
--- a/packages/react-core/src/components/Accordion/__tests__/__snapshots__/Accordion.test.tsx.snap
+++ b/packages/react-core/src/components/Accordion/__tests__/__snapshots__/Accordion.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Accordion Accordion bordered 1`] = `
-
+
`;
exports[`Accordion Accordion custom content 1`] = `
-
+
`;
exports[`Accordion Accordion default 1`] = `
-
+
`;
exports[`Accordion Accordion display large 1`] = `
-
+
`;
exports[`Accordion Accordion with non-default headingLevel 1`] = `
-
-
+
`;
diff --git a/packages/react-core/src/components/ActionList/__tests__/ActionList.test.tsx b/packages/react-core/src/components/ActionList/__tests__/ActionList.test.tsx
index a531f44d10e..ae5da51e036 100644
--- a/packages/react-core/src/components/ActionList/__tests__/ActionList.test.tsx
+++ b/packages/react-core/src/components/ActionList/__tests__/ActionList.test.tsx
@@ -4,11 +4,11 @@ import { ActionList } from '../ActionList';
describe('action list', () => {
test('renders successfully', () => {
- const view = render(test);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(test);
+ expect(asFragment()).toMatchSnapshot();
});
test('isIconList flag adds modifier', () => {
- const view = render(test);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(test);
+ expect(asFragment()).toMatchSnapshot();
});
});
diff --git a/packages/react-core/src/components/ActionList/__tests__/ActionListGroup.test.tsx b/packages/react-core/src/components/ActionList/__tests__/ActionListGroup.test.tsx
index 8744d36ecd1..4f1f2ddd74b 100644
--- a/packages/react-core/src/components/ActionList/__tests__/ActionListGroup.test.tsx
+++ b/packages/react-core/src/components/ActionList/__tests__/ActionListGroup.test.tsx
@@ -4,7 +4,7 @@ import { ActionListGroup } from '../ActionListGroup';
describe('action list group', () => {
test('renders successfully', () => {
- const view = render(test);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(test);
+ expect(asFragment()).toMatchSnapshot();
});
});
diff --git a/packages/react-core/src/components/ActionList/__tests__/ActionListItem.test.tsx b/packages/react-core/src/components/ActionList/__tests__/ActionListItem.test.tsx
index 7d84d727eb7..7be807a1ecb 100644
--- a/packages/react-core/src/components/ActionList/__tests__/ActionListItem.test.tsx
+++ b/packages/react-core/src/components/ActionList/__tests__/ActionListItem.test.tsx
@@ -4,7 +4,7 @@ import { ActionListItem } from '../ActionListItem';
describe('action list item', () => {
test('renders successfully', () => {
- const view = render(test);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(test);
+ expect(asFragment()).toMatchSnapshot();
});
});
diff --git a/packages/react-core/src/components/ActionList/__tests__/__snapshots__/ActionList.test.tsx.snap b/packages/react-core/src/components/ActionList/__tests__/__snapshots__/ActionList.test.tsx.snap
index c24a4e5c800..d010d4a0f0b 100644
--- a/packages/react-core/src/components/ActionList/__tests__/__snapshots__/ActionList.test.tsx.snap
+++ b/packages/react-core/src/components/ActionList/__tests__/__snapshots__/ActionList.test.tsx.snap
@@ -1,21 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`action list isIconList flag adds modifier 1`] = `
-
+
`;
exports[`action list renders successfully 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/ActionList/__tests__/__snapshots__/ActionListGroup.test.tsx.snap b/packages/react-core/src/components/ActionList/__tests__/__snapshots__/ActionListGroup.test.tsx.snap
index 40020482ddc..c1cc0d63d80 100644
--- a/packages/react-core/src/components/ActionList/__tests__/__snapshots__/ActionListGroup.test.tsx.snap
+++ b/packages/react-core/src/components/ActionList/__tests__/__snapshots__/ActionListGroup.test.tsx.snap
@@ -1,11 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`action list group renders successfully 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/ActionList/__tests__/__snapshots__/ActionListItem.test.tsx.snap b/packages/react-core/src/components/ActionList/__tests__/__snapshots__/ActionListItem.test.tsx.snap
index f2b20743a09..8999e1b84a4 100644
--- a/packages/react-core/src/components/ActionList/__tests__/__snapshots__/ActionListItem.test.tsx.snap
+++ b/packages/react-core/src/components/ActionList/__tests__/__snapshots__/ActionListItem.test.tsx.snap
@@ -1,11 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`action list item renders successfully 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/Alert/__tests__/Alert.test.tsx b/packages/react-core/src/components/Alert/__tests__/Alert.test.tsx
index a982f2fb497..006095e89b0 100644
--- a/packages/react-core/src/components/Alert/__tests__/Alert.test.tsx
+++ b/packages/react-core/src/components/Alert/__tests__/Alert.test.tsx
@@ -1,4 +1,5 @@
import * as React from 'react';
+
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
@@ -10,45 +11,45 @@ import { UsersIcon } from '@patternfly/react-icons';
describe('Alert', () => {
test('default Alert variant is default', () => {
render(Alert testing);
- expect(screen.getByText('this is a test').className).toContain('pf-c-alert');
+ expect(screen.getByText('this is a test')).toHaveClass('pf-c-alert__title');
});
Object.values(AlertVariant).forEach(variant => {
describe(`Alert - ${variant}`, () => {
test('Description', () => {
- const view = render(
+ const { asFragment } = render(
Some alert
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('Title', () => {
- const view = render(
+ const { asFragment } = render(
Some alert
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('Heading level', () => {
- const view = render(
+ const { asFragment } = render(
Some alert
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('Action Link', () => {
- const view = render(
+ const { asFragment } = render(
test]} title="">
Some alert
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('Action Close Button', () => {
@@ -69,7 +70,7 @@ describe('Alert', () => {
});
test('Action and Title', () => {
- const view = render(
+ const { asFragment } = render(
test]}
@@ -78,11 +79,11 @@ describe('Alert', () => {
Some alert
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('Custom aria label', () => {
- const view = render(
+ const { asFragment } = render(
{
Some alert
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('inline variation', () => {
- const view = render(
+ const { asFragment } = render(
Some alert
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('expandable variation', () => {
- const view = render(
+ const { asFragment } = render(
Success alert description. This should tell the user more information about the alert.
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('expandable variation description hidden', () => {
@@ -126,12 +127,12 @@ describe('Alert', () => {
});
test('Toast alerts match snapsnot', () => {
- const view = render(
+ const { asFragment } = render(
Some toast alert
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('Toast alerts contain default live region', () => {
@@ -143,7 +144,7 @@ describe('Alert', () => {
);
- expect(screen.getByLabelText(ariaLabel).getAttribute('aria-live')).toEqual('polite');
+ expect(screen.getByLabelText(ariaLabel)).toHaveAttribute('aria-live', 'polite');
});
test('Toast alert live regions are not atomic', () => {
@@ -155,7 +156,7 @@ describe('Alert', () => {
);
- expect(screen.getByLabelText(ariaLabel).getAttribute('aria-atomic')).toEqual('false');
+ expect(screen.getByLabelText(ariaLabel)).toHaveAttribute('aria-atomic', 'false');
});
test('Non-toast alerts can have custom live region settings', () => {
@@ -175,13 +176,13 @@ describe('Alert', () => {
);
const alert = screen.getByLabelText(ariaLabel);
- expect(alert.getAttribute('aria-live')).toEqual('assertive');
- expect(alert.getAttribute('aria-relevant')).toEqual('all');
- expect(alert.getAttribute('aria-atomic')).toEqual('true');
+ expect(alert).toHaveAttribute('aria-live', 'assertive');
+ expect(alert).toHaveAttribute('aria-relevant', 'all');
+ expect(alert).toHaveAttribute('aria-atomic', 'true');
});
test('Custom icon', () => {
- const view = render(
+ const { asFragment } = render(
}
variant={variant}
@@ -191,7 +192,7 @@ describe('Alert', () => {
Some noisy alert
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
});
});
@@ -203,6 +204,6 @@ describe('Alert', () => {
);
- expect(screen.getByText('this is a test').className).toContain('pf-m-truncate');
+ expect(screen.getByText('this is a test')).toHaveClass('pf-m-truncate');
});
});
diff --git a/packages/react-core/src/components/Alert/__tests__/Generated/AlertActionCloseButton.test.tsx b/packages/react-core/src/components/Alert/__tests__/Generated/AlertActionCloseButton.test.tsx
index e02b22c56ce..5bbd710608a 100644
--- a/packages/react-core/src/components/Alert/__tests__/Generated/AlertActionCloseButton.test.tsx
+++ b/packages/react-core/src/components/Alert/__tests__/Generated/AlertActionCloseButton.test.tsx
@@ -7,7 +7,7 @@ import { AlertContext } from '../../AlertContext';
describe('AlertActionCloseButton', () => {
it('should match snapshot', () => {
- const view = render(
+ const { asFragment } = render(
{
/>
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
});
diff --git a/packages/react-core/src/components/Alert/__tests__/Generated/AlertActionLink.test.tsx b/packages/react-core/src/components/Alert/__tests__/Generated/AlertActionLink.test.tsx
index 861c033b6ff..21600743628 100644
--- a/packages/react-core/src/components/Alert/__tests__/Generated/AlertActionLink.test.tsx
+++ b/packages/react-core/src/components/Alert/__tests__/Generated/AlertActionLink.test.tsx
@@ -8,6 +8,6 @@ import { AlertActionLink } from '../../AlertActionLink';
import {} from '../..';
it('AlertActionLink should match snapshot (auto-generated)', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/Alert/__tests__/Generated/AlertIcon.test.tsx b/packages/react-core/src/components/Alert/__tests__/Generated/AlertIcon.test.tsx
index 606eed7f023..fd0fb6005b3 100644
--- a/packages/react-core/src/components/Alert/__tests__/Generated/AlertIcon.test.tsx
+++ b/packages/react-core/src/components/Alert/__tests__/Generated/AlertIcon.test.tsx
@@ -8,6 +8,6 @@ import { AlertIcon } from '../../AlertIcon';
import {} from '../..';
it('AlertIcon should match snapshot (auto-generated)', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/Alert/__tests__/Generated/__snapshots__/AlertActionCloseButton.test.tsx.snap b/packages/react-core/src/components/Alert/__tests__/Generated/__snapshots__/AlertActionCloseButton.test.tsx.snap
index cc0841b3d4d..d3038015afb 100644
--- a/packages/react-core/src/components/Alert/__tests__/Generated/__snapshots__/AlertActionCloseButton.test.tsx.snap
+++ b/packages/react-core/src/components/Alert/__tests__/Generated/__snapshots__/AlertActionCloseButton.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AlertActionCloseButton should match snapshot 1`] = `
-
+
-
+
`;
diff --git a/packages/react-core/src/components/Alert/__tests__/Generated/__snapshots__/AlertActionLink.test.tsx.snap b/packages/react-core/src/components/Alert/__tests__/Generated/__snapshots__/AlertActionLink.test.tsx.snap
index 5d1275789fe..3182c7b493e 100644
--- a/packages/react-core/src/components/Alert/__tests__/Generated/__snapshots__/AlertActionLink.test.tsx.snap
+++ b/packages/react-core/src/components/Alert/__tests__/Generated/__snapshots__/AlertActionLink.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AlertActionLink should match snapshot (auto-generated) 1`] = `
-
+
-
+
`;
diff --git a/packages/react-core/src/components/Alert/__tests__/Generated/__snapshots__/AlertIcon.test.tsx.snap b/packages/react-core/src/components/Alert/__tests__/Generated/__snapshots__/AlertIcon.test.tsx.snap
index c29860e3421..ceca9c159b0 100644
--- a/packages/react-core/src/components/Alert/__tests__/Generated/__snapshots__/AlertIcon.test.tsx.snap
+++ b/packages/react-core/src/components/Alert/__tests__/Generated/__snapshots__/AlertIcon.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AlertIcon should match snapshot (auto-generated) 1`] = `
-
+
@@ -19,5 +19,5 @@ exports[`AlertIcon should match snapshot (auto-generated) 1`] = `
/>
-
+
`;
diff --git a/packages/react-core/src/components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap b/packages/react-core/src/components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap
index 4f2118a687b..6d3f59a100e 100644
--- a/packages/react-core/src/components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap
+++ b/packages/react-core/src/components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Alert Alert - danger Action Link 1`] = `
-
+
`;
exports[`Alert Alert - danger Action and Title 1`] = `
-
-
+
`;
exports[`Alert Alert - danger Custom aria label 1`] = `
-
-
+
`;
exports[`Alert Alert - danger Custom icon 1`] = `
-
+
`;
exports[`Alert Alert - danger Description 1`] = `
-
+
+
`;
exports[`Alert Alert - danger Heading level 1`] = `
-
+
`;
exports[`Alert Alert - danger Title 1`] = `
-
+
`;
exports[`Alert Alert - danger Toast alerts match snapsnot 1`] = `
-
+
`;
exports[`Alert Alert - danger expandable variation 1`] = `
-
+
`;
exports[`Alert Alert - danger inline variation 1`] = `
-
+
`;
exports[`Alert Alert - default Action Link 1`] = `
-
+
`;
exports[`Alert Alert - default Action and Title 1`] = `
-
-
+
`;
exports[`Alert Alert - default Custom aria label 1`] = `
-
-
+
`;
exports[`Alert Alert - default Custom icon 1`] = `
-
+
`;
exports[`Alert Alert - default Description 1`] = `
-
+
+
`;
exports[`Alert Alert - default Heading level 1`] = `
-
+
`;
exports[`Alert Alert - default Title 1`] = `
-
+
`;
exports[`Alert Alert - default Toast alerts match snapsnot 1`] = `
-
+
`;
exports[`Alert Alert - default expandable variation 1`] = `
-
+
`;
exports[`Alert Alert - default inline variation 1`] = `
-
+
`;
exports[`Alert Alert - info Action Link 1`] = `
-
+
`;
exports[`Alert Alert - info Action and Title 1`] = `
-
-
+
`;
exports[`Alert Alert - info Custom aria label 1`] = `
-
-
+
`;
exports[`Alert Alert - info Custom icon 1`] = `
-
+
`;
exports[`Alert Alert - info Description 1`] = `
-
+
+
`;
exports[`Alert Alert - info Heading level 1`] = `
-
+
`;
exports[`Alert Alert - info Title 1`] = `
-
+
`;
exports[`Alert Alert - info Toast alerts match snapsnot 1`] = `
-
+
`;
exports[`Alert Alert - info expandable variation 1`] = `
-
+
`;
exports[`Alert Alert - info inline variation 1`] = `
-
+
`;
exports[`Alert Alert - success Action Link 1`] = `
-
+
`;
exports[`Alert Alert - success Action and Title 1`] = `
-
-
+
`;
exports[`Alert Alert - success Custom aria label 1`] = `
-
-
+
`;
exports[`Alert Alert - success Custom icon 1`] = `
-
+
`;
exports[`Alert Alert - success Description 1`] = `
-
+
+
`;
exports[`Alert Alert - success Heading level 1`] = `
-
+
`;
exports[`Alert Alert - success Title 1`] = `
-
+
`;
exports[`Alert Alert - success Toast alerts match snapsnot 1`] = `
-
+
`;
exports[`Alert Alert - success expandable variation 1`] = `
-
+
`;
exports[`Alert Alert - success inline variation 1`] = `
-
+
`;
exports[`Alert Alert - warning Action Link 1`] = `
-
+
`;
exports[`Alert Alert - warning Action and Title 1`] = `
-
-
+
`;
exports[`Alert Alert - warning Custom aria label 1`] = `
-
-
+
`;
exports[`Alert Alert - warning Custom icon 1`] = `
-
+
`;
exports[`Alert Alert - warning Description 1`] = `
-
+
+
`;
exports[`Alert Alert - warning Heading level 1`] = `
-
+
`;
exports[`Alert Alert - warning Title 1`] = `
-
+
`;
exports[`Alert Alert - warning Toast alerts match snapsnot 1`] = `
-
+
`;
exports[`Alert Alert - warning expandable variation 1`] = `
-
+
`;
exports[`Alert Alert - warning inline variation 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/AlertGroup/__tests__/AlertGroup.test.tsx b/packages/react-core/src/components/AlertGroup/__tests__/AlertGroup.test.tsx
index fcf8fd70895..d34d82d8381 100644
--- a/packages/react-core/src/components/AlertGroup/__tests__/AlertGroup.test.tsx
+++ b/packages/react-core/src/components/AlertGroup/__tests__/AlertGroup.test.tsx
@@ -2,7 +2,6 @@ import * as React from 'react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
-import '@testing-library/jest-dom';
import { Alert } from '../../Alert';
import { AlertGroup } from '../../AlertGroup';
@@ -10,18 +9,18 @@ import { AlertActionCloseButton } from '../../../components/Alert/AlertActionClo
describe('AlertGroup', () => {
test('Alert Group renders without children', () => {
- const view = render(
);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(
);
+ expect(asFragment()).toMatchSnapshot();
});
test('Alert Group works with n children', () => {
- const view = render(
+ const { asFragment } = render(
);
- expect(view).toBeTruthy();
+ expect(asFragment()).toBeTruthy();
});
test('Alert group overflow shows up', () => {
@@ -40,7 +39,7 @@ describe('AlertGroup', () => {
expect(overflowButton).toBeInTheDocument();
userEvent.click(overflowButton);
- expect(onOverflowClick).toBeCalled();
+ expect(onOverflowClick).toHaveBeenCalled();
});
test('Standard Alert Group is not a toast alert group', () => {
@@ -77,6 +76,6 @@ describe('AlertGroup', () => {
);
userEvent.click(screen.getByLabelText('Close'));
- expect(onClose).toBeCalled();
+ expect(onClose).toHaveBeenCalled();
});
});
diff --git a/packages/react-core/src/components/AlertGroup/__tests__/Generated/AlertGroup.test.tsx b/packages/react-core/src/components/AlertGroup/__tests__/Generated/AlertGroup.test.tsx
index 343a29efe32..b88c41d42bf 100644
--- a/packages/react-core/src/components/AlertGroup/__tests__/Generated/AlertGroup.test.tsx
+++ b/packages/react-core/src/components/AlertGroup/__tests__/Generated/AlertGroup.test.tsx
@@ -8,8 +8,8 @@ import { AlertGroup } from '../../AlertGroup';
import {} from '../..';
it('AlertGroup should match snapshot (auto-generated)', () => {
- const view = render(
+ const { asFragment } = render(
ReactNode } isToast={true} appendTo={undefined} />
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/AlertGroup/__tests__/Generated/AlertGroupInline.test.tsx b/packages/react-core/src/components/AlertGroup/__tests__/Generated/AlertGroupInline.test.tsx
index e52e2776498..4cdec220359 100644
--- a/packages/react-core/src/components/AlertGroup/__tests__/Generated/AlertGroupInline.test.tsx
+++ b/packages/react-core/src/components/AlertGroup/__tests__/Generated/AlertGroupInline.test.tsx
@@ -8,6 +8,6 @@ import { AlertGroupInline } from '../../AlertGroupInline';
import {} from '../..';
it('AlertGroupInline should match snapshot (auto-generated)', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/AlertGroup/__tests__/Generated/__snapshots__/AlertGroup.test.tsx.snap b/packages/react-core/src/components/AlertGroup/__tests__/Generated/__snapshots__/AlertGroup.test.tsx.snap
index b46feaf5cc5..c704bee01bc 100644
--- a/packages/react-core/src/components/AlertGroup/__tests__/Generated/__snapshots__/AlertGroup.test.tsx.snap
+++ b/packages/react-core/src/components/AlertGroup/__tests__/Generated/__snapshots__/AlertGroup.test.tsx.snap
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AlertGroup should match snapshot (auto-generated) 1`] = ``;
+exports[`AlertGroup should match snapshot (auto-generated) 1`] = ``;
diff --git a/packages/react-core/src/components/AlertGroup/__tests__/Generated/__snapshots__/AlertGroupInline.test.tsx.snap b/packages/react-core/src/components/AlertGroup/__tests__/Generated/__snapshots__/AlertGroupInline.test.tsx.snap
index cfa118d32f4..cfc521424a7 100644
--- a/packages/react-core/src/components/AlertGroup/__tests__/Generated/__snapshots__/AlertGroupInline.test.tsx.snap
+++ b/packages/react-core/src/components/AlertGroup/__tests__/Generated/__snapshots__/AlertGroupInline.test.tsx.snap
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AlertGroupInline should match snapshot (auto-generated) 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/AlertGroup/__tests__/__snapshots__/AlertGroup.test.tsx.snap b/packages/react-core/src/components/AlertGroup/__tests__/__snapshots__/AlertGroup.test.tsx.snap
index 26368230b48..ecd04b19c1c 100644
--- a/packages/react-core/src/components/AlertGroup/__tests__/__snapshots__/AlertGroup.test.tsx.snap
+++ b/packages/react-core/src/components/AlertGroup/__tests__/__snapshots__/AlertGroup.test.tsx.snap
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AlertGroup Alert Group renders without children 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/ApplicationLauncher/__tests__/ApplicationLauncher.test.tsx b/packages/react-core/src/components/ApplicationLauncher/__tests__/ApplicationLauncher.test.tsx
index b5a94993cc7..49eac289b72 100644
--- a/packages/react-core/src/components/ApplicationLauncher/__tests__/ApplicationLauncher.test.tsx
+++ b/packages/react-core/src/components/ApplicationLauncher/__tests__/ApplicationLauncher.test.tsx
@@ -27,40 +27,36 @@ const dropdownItems = [
describe('ApplicationLauncher', () => {
test('regular', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('right aligned', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('dropup', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('dropup + right aligned', () => {
- const view = render(
-
+ const { asFragment } = render(
+
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('expanded', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('custom icon', () => {
- const view = render(
+ const { asFragment } = render(
} />
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
});
diff --git a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherContent.test.tsx b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherContent.test.tsx
index 43b7534fc24..4d76648527c 100644
--- a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherContent.test.tsx
+++ b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherContent.test.tsx
@@ -8,6 +8,6 @@ import { ApplicationLauncherContent } from '../../ApplicationLauncherContent';
import {} from '../..';
it('ApplicationLauncherContent should match snapshot (auto-generated)', () => {
- const view = render(ReactNode} />);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(ReactNode} />);
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherGroup.test.tsx b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherGroup.test.tsx
index 80094ea727c..d84f9c59175 100644
--- a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherGroup.test.tsx
+++ b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherGroup.test.tsx
@@ -8,6 +8,6 @@ import { ApplicationLauncherGroup } from '../../ApplicationLauncherGroup';
import {} from '../..';
it('ApplicationLauncherGroup should match snapshot (auto-generated)', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherIcon.test.tsx b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherIcon.test.tsx
index 9b6474dd322..3a4b6a72b8f 100644
--- a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherIcon.test.tsx
+++ b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherIcon.test.tsx
@@ -8,6 +8,6 @@ import { ApplicationLauncherIcon } from '../../ApplicationLauncherIcon';
import {} from '../..';
it('ApplicationLauncherIcon should match snapshot (auto-generated)', () => {
- const view = render(ReactNode} className={"''"} />);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(ReactNode} className={"''"} />);
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherSeparator.test.tsx b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherSeparator.test.tsx
index 02971bcbc9c..fbba4de4795 100644
--- a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherSeparator.test.tsx
+++ b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherSeparator.test.tsx
@@ -6,11 +6,11 @@ import { DropdownArrowContext } from '../../../Dropdown/dropdownConstants';
describe('ApplicationLauncherSeparator', () => {
it('should match snapshot', () => {
- const view = render(
+ const { asFragment } = render(
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
});
diff --git a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherText.test.tsx b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherText.test.tsx
index 7f38890f9a6..4208c3b4e63 100644
--- a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherText.test.tsx
+++ b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherText.test.tsx
@@ -8,6 +8,6 @@ import { ApplicationLauncherText } from '../../ApplicationLauncherText';
import {} from '../..';
it('ApplicationLauncherText should match snapshot (auto-generated)', () => {
- const view = render(ReactNode} className={"''"} />);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(ReactNode} className={"''"} />);
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherContent.test.tsx.snap b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherContent.test.tsx.snap
index 2fc0d996162..eaaeceb4bb3 100644
--- a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherContent.test.tsx.snap
+++ b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherContent.test.tsx.snap
@@ -1,9 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ApplicationLauncherContent should match snapshot (auto-generated) 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherGroup.test.tsx.snap b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherGroup.test.tsx.snap
index 7de502c5ecd..cac805c9416 100644
--- a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherGroup.test.tsx.snap
+++ b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherGroup.test.tsx.snap
@@ -1,14 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ApplicationLauncherGroup should match snapshot (auto-generated) 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherIcon.test.tsx.snap b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherIcon.test.tsx.snap
index ed9ab5746b3..46112bf757d 100644
--- a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherIcon.test.tsx.snap
+++ b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherIcon.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ApplicationLauncherIcon should match snapshot (auto-generated) 1`] = `
-
+
-
+
`;
diff --git a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherSeparator.test.tsx.snap b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherSeparator.test.tsx.snap
index fa9744a96ac..d69c576a95e 100644
--- a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherSeparator.test.tsx.snap
+++ b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherSeparator.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ApplicationLauncherSeparator should match snapshot 1`] = `
-
+
@@ -10,5 +10,5 @@ exports[`ApplicationLauncherSeparator should match snapshot 1`] = `
role="separator"
/>
-
+
`;
diff --git a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherText.test.tsx.snap b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherText.test.tsx.snap
index 69d202d634f..ab032302c3c 100644
--- a/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherText.test.tsx.snap
+++ b/packages/react-core/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherText.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ApplicationLauncherText should match snapshot (auto-generated) 1`] = `
-
+
-
+
`;
diff --git a/packages/react-core/src/components/ApplicationLauncher/__tests__/__snapshots__/ApplicationLauncher.test.tsx.snap b/packages/react-core/src/components/ApplicationLauncher/__tests__/__snapshots__/ApplicationLauncher.test.tsx.snap
index 2e3d115d837..ed8e5f70afe 100644
--- a/packages/react-core/src/components/ApplicationLauncher/__tests__/__snapshots__/ApplicationLauncher.test.tsx.snap
+++ b/packages/react-core/src/components/ApplicationLauncher/__tests__/__snapshots__/ApplicationLauncher.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ApplicationLauncher custom icon 1`] = `
-
+
-
+
`;
exports[`ApplicationLauncher dropup + right aligned 1`] = `
-
+
-
+
`;
exports[`ApplicationLauncher dropup 1`] = `
-
+
-
+
`;
exports[`ApplicationLauncher expanded 1`] = `
-
+
-
+
`;
exports[`ApplicationLauncher regular 1`] = `
-
+
-
+
`;
exports[`ApplicationLauncher right aligned 1`] = `
-
+
-
+
`;
diff --git a/packages/react-core/src/components/Avatar/__tests__/Avatar.test.tsx b/packages/react-core/src/components/Avatar/__tests__/Avatar.test.tsx
index 2084d601b38..179f7d61085 100644
--- a/packages/react-core/src/components/Avatar/__tests__/Avatar.test.tsx
+++ b/packages/react-core/src/components/Avatar/__tests__/Avatar.test.tsx
@@ -3,6 +3,6 @@ import { render } from '@testing-library/react';
import { Avatar } from '../Avatar';
test('simple avatar', () => {
- const view: any = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/Avatar/__tests__/__snapshots__/Avatar.test.tsx.snap b/packages/react-core/src/components/Avatar/__tests__/__snapshots__/Avatar.test.tsx.snap
index fcb59a50915..6ac2a939af3 100644
--- a/packages/react-core/src/components/Avatar/__tests__/__snapshots__/Avatar.test.tsx.snap
+++ b/packages/react-core/src/components/Avatar/__tests__/__snapshots__/Avatar.test.tsx.snap
@@ -1,11 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`simple avatar 1`] = `
-
+
-
+
`;
diff --git a/packages/react-core/src/components/BackToTop/__tests__/BackToTop.test.tsx b/packages/react-core/src/components/BackToTop/__tests__/BackToTop.test.tsx
index ae900b39a62..68703145014 100644
--- a/packages/react-core/src/components/BackToTop/__tests__/BackToTop.test.tsx
+++ b/packages/react-core/src/components/BackToTop/__tests__/BackToTop.test.tsx
@@ -4,19 +4,19 @@ import { BackToTop } from '../BackToTop';
describe('BackToTop', () => {
test('verify basic', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('verify custom class', () => {
- const view = render(test);
+ const { asFragment } = render(test);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('verify always show', () => {
- const view = render(test);
+ const { asFragment } = render(test);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
-});
\ No newline at end of file
+});
diff --git a/packages/react-core/src/components/BackToTop/__tests__/__snapshots__/BackToTop.test.tsx.snap b/packages/react-core/src/components/BackToTop/__tests__/__snapshots__/BackToTop.test.tsx.snap
index 8e75151e503..396367f61a4 100644
--- a/packages/react-core/src/components/BackToTop/__tests__/__snapshots__/BackToTop.test.tsx.snap
+++ b/packages/react-core/src/components/BackToTop/__tests__/__snapshots__/BackToTop.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`BackToTop verify always show 1`] = `
-
+
@@ -33,11 +33,11 @@ exports[`BackToTop verify always show 1`] = `
-
+
`;
exports[`BackToTop verify basic 1`] = `
-
+
@@ -69,11 +69,11 @@ exports[`BackToTop verify basic 1`] = `
-
+
`;
exports[`BackToTop verify custom class 1`] = `
-
+
@@ -105,5 +105,5 @@ exports[`BackToTop verify custom class 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/Backdrop/__tests__/Backdrop.test.tsx b/packages/react-core/src/components/Backdrop/__tests__/Backdrop.test.tsx
index 02d81d85356..3307faacceb 100644
--- a/packages/react-core/src/components/Backdrop/__tests__/Backdrop.test.tsx
+++ b/packages/react-core/src/components/Backdrop/__tests__/Backdrop.test.tsx
@@ -3,6 +3,6 @@ import { render } from '@testing-library/react';
import { Backdrop } from '../Backdrop';
test('Backdrop Test', () => {
- const view = render(Backdrop);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(Backdrop);
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/Backdrop/__tests__/__snapshots__/Backdrop.test.tsx.snap b/packages/react-core/src/components/Backdrop/__tests__/__snapshots__/Backdrop.test.tsx.snap
index 545a3c9ded5..c341a6f53f4 100644
--- a/packages/react-core/src/components/Backdrop/__tests__/__snapshots__/Backdrop.test.tsx.snap
+++ b/packages/react-core/src/components/Backdrop/__tests__/__snapshots__/Backdrop.test.tsx.snap
@@ -1,11 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Backdrop Test 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/BackgroundImage/__tests__/BackgroundImage.test.tsx b/packages/react-core/src/components/BackgroundImage/__tests__/BackgroundImage.test.tsx
index 3d922f91c68..e8ab030a4ea 100644
--- a/packages/react-core/src/components/BackgroundImage/__tests__/BackgroundImage.test.tsx
+++ b/packages/react-core/src/components/BackgroundImage/__tests__/BackgroundImage.test.tsx
@@ -3,19 +3,19 @@ import * as React from 'react';
import { render } from '@testing-library/react';
const images = {
- 'lg': '/assets/images/pfbg_1200.jpg',
- 'sm': '/assets/images/pfbg_768.jpg',
- 'sm2x': '/assets/images/pfbg_768@2x.jpg',
- 'xs': '/assets/images/pfbg_576.jpg',
- 'xs2x': '/assets/images/pfbg_576@2x.jpg'
+ lg: '/assets/images/pfbg_1200.jpg',
+ sm: '/assets/images/pfbg_768.jpg',
+ sm2x: '/assets/images/pfbg_768@2x.jpg',
+ xs: '/assets/images/pfbg_576.jpg',
+ xs2x: '/assets/images/pfbg_576@2x.jpg'
};
test('BackgroundImage', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('allows passing in a single string as the image src', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/BackgroundImage/__tests__/__snapshots__/BackgroundImage.test.tsx.snap b/packages/react-core/src/components/BackgroundImage/__tests__/__snapshots__/BackgroundImage.test.tsx.snap
index fe0cb3bcae9..6d2c7cf1122 100644
--- a/packages/react-core/src/components/BackgroundImage/__tests__/__snapshots__/BackgroundImage.test.tsx.snap
+++ b/packages/react-core/src/components/BackgroundImage/__tests__/__snapshots__/BackgroundImage.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`BackgroundImage 1`] = `
-
+
`;
exports[`allows passing in a single string as the image src 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/Badge/__tests__/Badge.test.tsx b/packages/react-core/src/components/Badge/__tests__/Badge.test.tsx
index d41ddeff3b8..492bc03ec83 100644
--- a/packages/react-core/src/components/Badge/__tests__/Badge.test.tsx
+++ b/packages/react-core/src/components/Badge/__tests__/Badge.test.tsx
@@ -4,7 +4,7 @@ import { render } from '@testing-library/react';
Object.values([true, false]).forEach(isRead => {
test(`${isRead} Badge`, () => {
- const view = render({isRead ? 'read' : 'unread'} Badge);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render({isRead ? 'read' : 'unread'} Badge);
+ expect(asFragment()).toMatchSnapshot();
});
});
diff --git a/packages/react-core/src/components/Badge/__tests__/__snapshots__/Badge.test.tsx.snap b/packages/react-core/src/components/Badge/__tests__/__snapshots__/Badge.test.tsx.snap
index 126e5157eb8..69ff36ba72e 100644
--- a/packages/react-core/src/components/Badge/__tests__/__snapshots__/Badge.test.tsx.snap
+++ b/packages/react-core/src/components/Badge/__tests__/__snapshots__/Badge.test.tsx.snap
@@ -1,23 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`false Badge 1`] = `
-
+
- unread
- Badge
+ unread Badge
-
+
`;
exports[`true Badge 1`] = `
-
+
- read
- Badge
+ read Badge
-
+
`;
diff --git a/packages/react-core/src/components/Banner/__tests__/Banner.test.tsx b/packages/react-core/src/components/Banner/__tests__/Banner.test.tsx
index 182cef9728e..3378df00675 100644
--- a/packages/react-core/src/components/Banner/__tests__/Banner.test.tsx
+++ b/packages/react-core/src/components/Banner/__tests__/Banner.test.tsx
@@ -2,24 +2,22 @@ import { Banner } from '../Banner';
import React from 'react';
import { render } from '@testing-library/react';
-['default', 'info', 'success', 'warning', 'danger'].forEach(
- (variant: 'default' | 'info' | 'success' | 'warning' | 'danger') => {
- test(`${variant} banner`, () => {
- const view = render(
-
- {variant} Banner
-
- );
- expect(view.container).toMatchSnapshot();
- });
- }
-);
+['default', 'info', 'success', 'warning', 'danger'].forEach((variant: string) => {
+ test(`${variant} banner`, () => {
+ const { asFragment } = render(
+
+ {variant} Banner
+
+ );
+ expect(asFragment()).toMatchSnapshot();
+ });
+});
test(`sticky banner`, () => {
- const view = render(
+ const { asFragment } = render(
Sticky Banner
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/Banner/__tests__/__snapshots__/Banner.test.tsx.snap b/packages/react-core/src/components/Banner/__tests__/__snapshots__/Banner.test.tsx.snap
index 366a8041ad2..902f1fca6ad 100644
--- a/packages/react-core/src/components/Banner/__tests__/__snapshots__/Banner.test.tsx.snap
+++ b/packages/react-core/src/components/Banner/__tests__/__snapshots__/Banner.test.tsx.snap
@@ -1,72 +1,67 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`danger banner 1`] = `
-
+
- danger
- Banner
+ danger Banner
-
+
`;
exports[`default banner 1`] = `
-
+
- default
- Banner
+ default Banner
-
+
`;
exports[`info banner 1`] = `
-
+
- info
- Banner
+ info Banner
-
+
`;
exports[`sticky banner 1`] = `
-
+
`;
exports[`success banner 1`] = `
-
+
- success
- Banner
+ success Banner
-
+
`;
exports[`warning banner 1`] = `
-
+
- warning
- Banner
+ warning Banner
-
+
`;
diff --git a/packages/react-core/src/components/Brand/__tests__/Brand.test.tsx b/packages/react-core/src/components/Brand/__tests__/Brand.test.tsx
index 48a2fb30a79..102e8510429 100644
--- a/packages/react-core/src/components/Brand/__tests__/Brand.test.tsx
+++ b/packages/react-core/src/components/Brand/__tests__/Brand.test.tsx
@@ -5,12 +5,13 @@ import '@testing-library/jest-dom';
describe('Brand', () => {
test('simple brand', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
+
test('passing children creates picture brand', () => {
- const view = render(
-
+ render(
+
test
);
diff --git a/packages/react-core/src/components/Brand/__tests__/__snapshots__/Brand.test.tsx.snap b/packages/react-core/src/components/Brand/__tests__/__snapshots__/Brand.test.tsx.snap
index 36f357fe594..5adddc3b108 100644
--- a/packages/react-core/src/components/Brand/__tests__/__snapshots__/Brand.test.tsx.snap
+++ b/packages/react-core/src/components/Brand/__tests__/__snapshots__/Brand.test.tsx.snap
@@ -1,11 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Brand simple brand 1`] = `
-
+
-
+
`;
diff --git a/packages/react-core/src/components/Breadcrumb/__tests__/Breadcrumb.test.tsx b/packages/react-core/src/components/Breadcrumb/__tests__/Breadcrumb.test.tsx
index 13b88ab727f..bc793f7313f 100644
--- a/packages/react-core/src/components/Breadcrumb/__tests__/Breadcrumb.test.tsx
+++ b/packages/react-core/src/components/Breadcrumb/__tests__/Breadcrumb.test.tsx
@@ -5,26 +5,26 @@ import { render } from '@testing-library/react';
describe('Breadcrumb component', () => {
test('should render default breadcrumb', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('should render breadcrumb with className', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('should render breadcrumb with aria-label', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('should render breadcrumb with children', () => {
- const view = render(
+ const { asFragment } = render(
Item 1 Item 1
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
});
diff --git a/packages/react-core/src/components/Breadcrumb/__tests__/BreadcrumbHeading.test.tsx b/packages/react-core/src/components/Breadcrumb/__tests__/BreadcrumbHeading.test.tsx
index 25c4e4aab55..a1c1f89c778 100644
--- a/packages/react-core/src/components/Breadcrumb/__tests__/BreadcrumbHeading.test.tsx
+++ b/packages/react-core/src/components/Breadcrumb/__tests__/BreadcrumbHeading.test.tsx
@@ -4,31 +4,31 @@ import { render } from '@testing-library/react';
describe('BreadcrumbHeading component', () => {
test('should render default breadcrumbHeading', () => {
- const view = render(Item);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(Item);
+ expect(asFragment()).toMatchSnapshot();
});
test('should pass classname', () => {
- const view = render(Item);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(Item);
+ expect(asFragment()).toMatchSnapshot();
});
test('should pass custom id', () => {
- const view = render(Item);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(Item);
+ expect(asFragment()).toMatchSnapshot();
});
test('should render link breadcrumbTitle', () => {
- const view = render(Item);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(Item);
+ expect(asFragment()).toMatchSnapshot();
});
test('should render breadcrumbHeading with target', () => {
- const view = render(
+ const { asFragment } = render(
Item
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
});
diff --git a/packages/react-core/src/components/Breadcrumb/__tests__/BreadcrumbItem.test.tsx b/packages/react-core/src/components/Breadcrumb/__tests__/BreadcrumbItem.test.tsx
index 9721ed242a1..d333bfda427 100644
--- a/packages/react-core/src/components/Breadcrumb/__tests__/BreadcrumbItem.test.tsx
+++ b/packages/react-core/src/components/Breadcrumb/__tests__/BreadcrumbItem.test.tsx
@@ -4,51 +4,49 @@ import { render } from '@testing-library/react';
describe('BreadcrumbItem component', () => {
test('should render default breadcrumbItem', () => {
- const view = render(Item);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(Item);
+ expect(asFragment()).toMatchSnapshot();
});
test('should render breadcrumbItem with className', () => {
- const view = render(Item);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(Item);
+ expect(asFragment()).toMatchSnapshot();
});
test('should render breadcrumbItem with id', () => {
- const view = render(Item);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(Item);
+ expect(asFragment()).toMatchSnapshot();
});
test('should render active breadcrumbItem', () => {
- const view = render(Item);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(Item);
+ expect(asFragment()).toMatchSnapshot();
});
test('should render link breadcrumbItem', () => {
- const view = render(Item);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(Item);
+ expect(asFragment()).toMatchSnapshot();
});
test('should render breadcrumbItem with target', () => {
- const view = render(Item);
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(Item);
+ expect(asFragment()).toMatchSnapshot();
});
test('should render breadcrumbItem with custom element', () => {
- const view = render(
+ const { asFragment } = render(
Header
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('should render breadcrumbItem with component', () => {
const MyComponent = () => My component contents
;
const consoleError = jest.spyOn(console, 'error').mockImplementation();
- const view = render(
- Stuff
- );
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render(Stuff);
+ expect(asFragment()).toMatchSnapshot();
expect(consoleError).not.toHaveBeenCalled();
});
});
diff --git a/packages/react-core/src/components/Breadcrumb/__tests__/__snapshots__/Breadcrumb.test.tsx.snap b/packages/react-core/src/components/Breadcrumb/__tests__/__snapshots__/Breadcrumb.test.tsx.snap
index e0b7c8682c5..0a30b033145 100644
--- a/packages/react-core/src/components/Breadcrumb/__tests__/__snapshots__/Breadcrumb.test.tsx.snap
+++ b/packages/react-core/src/components/Breadcrumb/__tests__/__snapshots__/Breadcrumb.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Breadcrumb component should render breadcrumb with aria-label 1`] = `
-
+
-
+
`;
exports[`Breadcrumb component should render breadcrumb with children 1`] = `
-
+
-
+
`;
exports[`Breadcrumb component should render breadcrumb with className 1`] = `
-
+
-
+
`;
exports[`Breadcrumb component should render default breadcrumb 1`] = `
-
+
-
+
`;
diff --git a/packages/react-core/src/components/Breadcrumb/__tests__/__snapshots__/BreadcrumbHeading.test.tsx.snap b/packages/react-core/src/components/Breadcrumb/__tests__/__snapshots__/BreadcrumbHeading.test.tsx.snap
index eeb48c1317c..f441c0c16a5 100644
--- a/packages/react-core/src/components/Breadcrumb/__tests__/__snapshots__/BreadcrumbHeading.test.tsx.snap
+++ b/packages/react-core/src/components/Breadcrumb/__tests__/__snapshots__/BreadcrumbHeading.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`BreadcrumbHeading component should pass classname 1`] = `
-
+
@@ -11,11 +11,11 @@ exports[`BreadcrumbHeading component should pass classname 1`] = `
Item
-
+
`;
exports[`BreadcrumbHeading component should pass custom id 1`] = `
-
+
-
+
`;
exports[`BreadcrumbHeading component should render breadcrumbHeading with target 1`] = `
-
+
@@ -47,11 +47,11 @@ exports[`BreadcrumbHeading component should render breadcrumbHeading with target
-
+
`;
exports[`BreadcrumbHeading component should render default breadcrumbHeading 1`] = `
-
+
@@ -61,11 +61,11 @@ exports[`BreadcrumbHeading component should render default breadcrumbHeading 1`]
Item
-
+
`;
exports[`BreadcrumbHeading component should render link breadcrumbTitle 1`] = `
-
+
@@ -81,5 +81,5 @@ exports[`BreadcrumbHeading component should render link breadcrumbTitle 1`] = `
-
+
`;
diff --git a/packages/react-core/src/components/Breadcrumb/__tests__/__snapshots__/BreadcrumbItem.test.tsx.snap b/packages/react-core/src/components/Breadcrumb/__tests__/__snapshots__/BreadcrumbItem.test.tsx.snap
index ddcfdc28697..9bc113a9dba 100644
--- a/packages/react-core/src/components/Breadcrumb/__tests__/__snapshots__/BreadcrumbItem.test.tsx.snap
+++ b/packages/react-core/src/components/Breadcrumb/__tests__/__snapshots__/BreadcrumbItem.test.tsx.snap
@@ -1,37 +1,37 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`BreadcrumbItem component should render active breadcrumbItem 1`] = `
-
+
Item
-
+
`;
exports[`BreadcrumbItem component should render breadcrumbItem with className 1`] = `
-
+
Item
-
+
`;
exports[`BreadcrumbItem component should render breadcrumbItem with component 1`] = `
-
+
Stuff
-
+
`;
exports[`BreadcrumbItem component should render breadcrumbItem with custom element 1`] = `
-
+
@@ -39,42 +39,42 @@ exports[`BreadcrumbItem component should render breadcrumbItem with custom eleme
Header
-
+
`;
exports[`BreadcrumbItem component should render breadcrumbItem with id 1`] = `
-
+
Item
-
+
`;
exports[`BreadcrumbItem component should render breadcrumbItem with target 1`] = `
-
+
Item
-
+
`;
exports[`BreadcrumbItem component should render default breadcrumbItem 1`] = `
-
+
Item
-
+
`;
exports[`BreadcrumbItem component should render link breadcrumbItem 1`] = `
-
+
@@ -85,5 +85,5 @@ exports[`BreadcrumbItem component should render link breadcrumbItem 1`] = `
Item
-
+
`;
diff --git a/packages/react-core/src/components/Button/__tests__/Button.test.tsx b/packages/react-core/src/components/Button/__tests__/Button.test.tsx
index 26fcfb993de..b8d19a3472e 100644
--- a/packages/react-core/src/components/Button/__tests__/Button.test.tsx
+++ b/packages/react-core/src/components/Button/__tests__/Button.test.tsx
@@ -1,7 +1,6 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
-import '@testing-library/jest-dom';
import CartArrowDownIcon from '@patternfly/react-icons/dist/esm/icons/cart-arrow-down-icon';
import { Button, ButtonVariant } from '../Button';
@@ -9,12 +8,12 @@ import { Button, ButtonVariant } from '../Button';
describe('Button', () => {
Object.values(ButtonVariant).forEach(variant => {
test(`${variant} button`, () => {
- const view = render(
+ const { asFragment } = render(
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
});
@@ -26,82 +25,82 @@ describe('Button', () => {
});
test('link with icon', () => {
- const view = render(
+ const { asFragment } = render(
}>
Block Button
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('isBlock', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('isDisabled', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('isDanger secondary', () => {
- const view = render(
+ const { asFragment } = render(
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('isDanger link', () => {
- const view = render(
+ const { asFragment } = render(
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('isAriaDisabled button', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('isAriaDisabled link button', () => {
- const view = render(
+ const { asFragment } = render(
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('isInline', () => {
- const view = render(
+ const { asFragment } = render(
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('isSmall', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('isLarge', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('isLoading', () => {
- const view = render(
+ const { asFragment } = render(
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('allows passing in a string as the component', () => {
@@ -119,23 +118,23 @@ describe('Button', () => {
});
test('aria-disabled is set to true and tabIndex to -1 if component is not a button and is disabled', () => {
- const view = render(
+ const { asFragment } = render(
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('setting tab index through props', () => {
render();
- expect(screen.getByRole('button').getAttribute('tabindex')).toEqual('0');
+ expect(screen.getByRole('button')).toHaveAttribute('tabindex', '0');
});
test('isLoading icon only', () => {
- const view = render(
+ const { asFragment } = render(
"`;
+exports[`FormHelperText LoginFooterItem with custom node 1`] = `
+
+
+
+ My custom node
+
+
+
+`;
-exports[`FormHelperText className is added to the root element 1`] = `"test
"`;
+exports[`FormHelperText className is added to the root element 1`] = `
+
+
+
+`;
-exports[`FormHelperText renders with PatternFly Core styles 1`] = `"test
"`;
+exports[`FormHelperText renders with PatternFly Core styles 1`] = `
+
+
+ test
+
+
+`;
-exports[`FormHelperText renders with icon 1`] = `"test
"`;
+exports[`FormHelperText renders with icon 1`] = `
+
+
+
+
+
+ test
+
+
+`;
diff --git a/packages/react-core/src/components/Form/__tests__/__snapshots__/FormSection.test.tsx.snap b/packages/react-core/src/components/Form/__tests__/__snapshots__/FormSection.test.tsx.snap
index 08724d3e83e..ca8bb447a09 100644
--- a/packages/react-core/src/components/Form/__tests__/__snapshots__/FormSection.test.tsx.snap
+++ b/packages/react-core/src/components/Form/__tests__/__snapshots__/FormSection.test.tsx.snap
@@ -1,17 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Check form section example against snapshot 1`] = `
-
+
-
+ />
+
`;
exports[`Check form section example with title 1`] = `
-
+
-
+
`;
diff --git a/packages/react-core/src/components/FormSelect/__tests__/FormSelect.test.tsx b/packages/react-core/src/components/FormSelect/__tests__/FormSelect.test.tsx
index b3f650e5688..b99224ec5b8 100644
--- a/packages/react-core/src/components/FormSelect/__tests__/FormSelect.test.tsx
+++ b/packages/react-core/src/components/FormSelect/__tests__/FormSelect.test.tsx
@@ -2,7 +2,6 @@ import React from 'react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
-import '@testing-library/jest-dom';
import { FormSelect } from '../FormSelect';
import { FormSelectOption } from '../FormSelectOption';
@@ -54,18 +53,18 @@ const groupedProps = {
describe('FormSelect', () => {
test('Simple FormSelect input', () => {
- render(
+ const { asFragment } = render(
{props.options.map((option, index) => (
))}
);
- expect(screen.getByLabelText('simple FormSelect').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('Grouped FormSelect input', () => {
- render(
+ const { asFragment } = render(
{groupedProps.groups.map((group, index) => (
@@ -76,71 +75,71 @@ describe('FormSelect', () => {
))}
);
- expect(screen.getByLabelText('grouped FormSelect').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('Disabled FormSelect input ', () => {
- render(
+ const { asFragment } = render(
);
- expect(screen.getByLabelText('disabled FormSelect').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('FormSelect input with aria-label does not generate console error', () => {
const myMock = jest.fn() as any;
global.console = { error: myMock } as any;
- render(
+ const { asFragment } = render(
);
- expect(screen.getByLabelText('label').outerHTML).toMatchSnapshot();
- expect(myMock).not.toBeCalled();
+ expect(asFragment()).toMatchSnapshot();
+ expect(myMock).not.toHaveBeenCalled();
});
test('FormSelect input with id does not generate console error', () => {
const myMock = jest.fn() as any;
global.console = { error: myMock } as any;
- render(
+ const { asFragment } = render(
);
- expect(screen.getByLabelText('label').outerHTML).toMatchSnapshot();
- expect(myMock).not.toBeCalled();
+ expect(asFragment()).toMatchSnapshot();
+ expect(myMock).not.toHaveBeenCalled();
});
test('FormSelect input with no aria-label or id generates console error', () => {
const myMock = jest.fn() as any;
global.console = { error: myMock } as any;
- render(
+ const { asFragment } = render(
);
- expect(screen.getByTestId('test-id').outerHTML).toMatchSnapshot();
- expect(myMock).toBeCalled();
+ expect(asFragment()).toMatchSnapshot();
+ expect(myMock).toHaveBeenCalled();
});
test('invalid FormSelect input', () => {
- render(
+ const { asFragment } = render(
);
- expect(screen.getByLabelText('invalid FormSelect').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('validated success FormSelect input', () => {
- render(
+ const { asFragment } = render(
@@ -148,12 +147,12 @@ describe('FormSelect', () => {
const formSelect = screen.getByLabelText('validated FormSelect');
- expect(formSelect.className).toContain('pf-m-success');
- expect(formSelect.outerHTML).toMatchSnapshot();
+ expect(formSelect).toHaveClass('pf-m-success');
+ expect(asFragment()).toMatchSnapshot();
});
test('validated warning FormSelect input', () => {
- render(
+ const { asFragment } = render(
@@ -161,8 +160,8 @@ describe('FormSelect', () => {
const formSelect = screen.getByLabelText('validated FormSelect');
- expect(formSelect.className).toContain('pf-m-warning');
- expect(formSelect.outerHTML).toMatchSnapshot();
+ expect(formSelect).toHaveClass('pf-m-warning');
+ expect(asFragment()).toMatchSnapshot();
});
test('required FormSelect input', () => {
@@ -186,7 +185,7 @@ describe('FormSelect', () => {
userEvent.selectOptions(screen.getByLabelText('Some label'), 'Mr');
- expect(myMock).toBeCalled();
+ expect(myMock).toHaveBeenCalled();
expect(myMock.mock.calls[0][0]).toEqual('mr');
});
});
diff --git a/packages/react-core/src/components/FormSelect/__tests__/Generated/FormSelectOption.test.tsx b/packages/react-core/src/components/FormSelect/__tests__/Generated/FormSelectOption.test.tsx
index 52d4f8d32ef..8592d0a9dfc 100644
--- a/packages/react-core/src/components/FormSelect/__tests__/Generated/FormSelectOption.test.tsx
+++ b/packages/react-core/src/components/FormSelect/__tests__/Generated/FormSelectOption.test.tsx
@@ -8,6 +8,6 @@ import { FormSelectOption } from '../../FormSelectOption';
import {} from '../..';
it('FormSelectOption should match snapshot (auto-generated)', () => {
- const view = render();
- expect(view.container).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/FormSelect/__tests__/Generated/FormSelectOptionGroup.test.tsx b/packages/react-core/src/components/FormSelect/__tests__/Generated/FormSelectOptionGroup.test.tsx
index f1336e3bb06..fcb1a57b6f7 100644
--- a/packages/react-core/src/components/FormSelect/__tests__/Generated/FormSelectOptionGroup.test.tsx
+++ b/packages/react-core/src/components/FormSelect/__tests__/Generated/FormSelectOptionGroup.test.tsx
@@ -8,8 +8,8 @@ import { FormSelectOptionGroup } from '../../FormSelectOptionGroup';
import {} from '../..';
it('FormSelectOptionGroup should match snapshot (auto-generated)', () => {
- const view = render(
+ const { asFragment } = render(
ReactNode>} className={"''"} label={'string'} isDisabled={false} />
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/FormSelect/__tests__/Generated/__snapshots__/FormSelectOption.test.tsx.snap b/packages/react-core/src/components/FormSelect/__tests__/Generated/__snapshots__/FormSelectOption.test.tsx.snap
index 9b44beabe4e..333bd0012a8 100644
--- a/packages/react-core/src/components/FormSelect/__tests__/Generated/__snapshots__/FormSelectOption.test.tsx.snap
+++ b/packages/react-core/src/components/FormSelect/__tests__/Generated/__snapshots__/FormSelectOption.test.tsx.snap
@@ -1,12 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`FormSelectOption should match snapshot (auto-generated) 1`] = `
-
+
-
+
`;
diff --git a/packages/react-core/src/components/FormSelect/__tests__/Generated/__snapshots__/FormSelectOptionGroup.test.tsx.snap b/packages/react-core/src/components/FormSelect/__tests__/Generated/__snapshots__/FormSelectOptionGroup.test.tsx.snap
index edd43ce9483..2aa0cf1ec40 100644
--- a/packages/react-core/src/components/FormSelect/__tests__/Generated/__snapshots__/FormSelectOptionGroup.test.tsx.snap
+++ b/packages/react-core/src/components/FormSelect/__tests__/Generated/__snapshots__/FormSelectOptionGroup.test.tsx.snap
@@ -1,12 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`FormSelectOptionGroup should match snapshot (auto-generated) 1`] = `
-
+
-
+
`;
diff --git a/packages/react-core/src/components/FormSelect/__tests__/__snapshots__/FormSelect.test.tsx.snap b/packages/react-core/src/components/FormSelect/__tests__/__snapshots__/FormSelect.test.tsx.snap
index 2cf1a416d87..50981583bbf 100644
--- a/packages/react-core/src/components/FormSelect/__tests__/__snapshots__/FormSelect.test.tsx.snap
+++ b/packages/react-core/src/components/FormSelect/__tests__/__snapshots__/FormSelect.test.tsx.snap
@@ -1,19 +1,267 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`FormSelect Disabled FormSelect input 1`] = `""`;
+exports[`FormSelect Disabled FormSelect input 1`] = `
+
+
+
+`;
-exports[`FormSelect FormSelect input with aria-label does not generate console error 1`] = `""`;
+exports[`FormSelect FormSelect input with aria-label does not generate console error 1`] = `
+
+
+
+`;
-exports[`FormSelect FormSelect input with id does not generate console error 1`] = `""`;
+exports[`FormSelect FormSelect input with id does not generate console error 1`] = `
+
+
+
+`;
-exports[`FormSelect FormSelect input with no aria-label or id generates console error 1`] = `""`;
+exports[`FormSelect FormSelect input with no aria-label or id generates console error 1`] = `
+
+
+
+`;
-exports[`FormSelect Grouped FormSelect input 1`] = `""`;
+exports[`FormSelect Grouped FormSelect input 1`] = `
+
+
+
+`;
-exports[`FormSelect Simple FormSelect input 1`] = `""`;
+exports[`FormSelect Simple FormSelect input 1`] = `
+
+
+
+`;
-exports[`FormSelect invalid FormSelect input 1`] = `""`;
+exports[`FormSelect invalid FormSelect input 1`] = `
+
+
+
+`;
-exports[`FormSelect validated success FormSelect input 1`] = `""`;
+exports[`FormSelect validated success FormSelect input 1`] = `
+
+
+
+`;
-exports[`FormSelect validated warning FormSelect input 1`] = `""`;
+exports[`FormSelect validated warning FormSelect input 1`] = `
+
+
+
+`;
diff --git a/packages/react-core/src/components/HelperText/__tests__/HelperText.test.tsx b/packages/react-core/src/components/HelperText/__tests__/HelperText.test.tsx
index de882946619..e552b46f90c 100644
--- a/packages/react-core/src/components/HelperText/__tests__/HelperText.test.tsx
+++ b/packages/react-core/src/components/HelperText/__tests__/HelperText.test.tsx
@@ -6,61 +6,61 @@ import { CheckIcon } from '@patternfly/react-icons';
describe('HelperText', () => {
test('simple helper text renders successfully', () => {
- const view = render(
+ const { asFragment } = render(
help test text
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
Object.values(['default', 'indeterminate', 'warning', 'success', 'invalid']).forEach(variant => {
test(`${variant} helper text variant applies successfully`, () => {
- const view = render(
-
+ const { asFragment } = render(
+
{variant} help test text
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
});
test('variant comonent helper text renders properly', () => {
- const view = render(
+ const { asFragment } = render(
help test text 1
help test text 2
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('icon helper text renders properly', () => {
- const view = render(
+ const { asFragment } = render(
}>help test text
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('dynamic helper text renders successfully', () => {
- const view = render(
+ const { asFragment } = render(
help test text
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('helper text block renders successfully', () => {
- const view = render(
+ const { asFragment } = render(
help test text 1
help test text 2
help test text 3
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
});
diff --git a/packages/react-core/src/components/HelperText/__tests__/__snapshots__/HelperText.test.tsx.snap b/packages/react-core/src/components/HelperText/__tests__/__snapshots__/HelperText.test.tsx.snap
index 4f8c4d9d25e..c7f1dec8744 100644
--- a/packages/react-core/src/components/HelperText/__tests__/__snapshots__/HelperText.test.tsx.snap
+++ b/packages/react-core/src/components/HelperText/__tests__/__snapshots__/HelperText.test.tsx.snap
@@ -1,22 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`HelperText default helper text variant applies successfully 1`] = `
-
+
- default
- help test text
+ default help test text
-
+
`;
exports[`HelperText dynamic helper text renders successfully 1`] = `
-
+
@@ -48,11 +47,11 @@ exports[`HelperText dynamic helper text renders successfully 1`] = `
-
+
`;
exports[`HelperText helper text block renders successfully 1`] = `
-
+
@@ -84,11 +83,11 @@ exports[`HelperText helper text block renders successfully 1`] = `
-
+
`;
exports[`HelperText icon helper text renders properly 1`] = `
-
+
@@ -120,41 +119,39 @@ exports[`HelperText icon helper text renders properly 1`] = `
-
+
`;
exports[`HelperText indeterminate helper text variant applies successfully 1`] = `
-
+
- indeterminate
- help test text
+ indeterminate help test text
-
+
`;
exports[`HelperText invalid helper text variant applies successfully 1`] = `
-
+
- invalid
- help test text
+ invalid help test text
-
+
`;
exports[`HelperText simple helper text renders successfully 1`] = `
-
+
@@ -168,26 +165,25 @@ exports[`HelperText simple helper text renders successfully 1`] = `
-
+
`;
exports[`HelperText success helper text variant applies successfully 1`] = `
-
+
- success
- help test text
+ success help test text
-
+
`;
exports[`HelperText variant comonent helper text renders properly 1`] = `
-
+
@@ -210,20 +206,19 @@ exports[`HelperText variant comonent helper text renders properly 1`] = `
-
+
`;
exports[`HelperText warning helper text variant applies successfully 1`] = `
-
+
- warning
- help test text
+ warning help test text
-
+
`;
diff --git a/packages/react-core/src/components/Hint/__tests__/Hint.test.tsx b/packages/react-core/src/components/Hint/__tests__/Hint.test.tsx
index 81d0f2f4b2a..c59ce9a96fa 100644
--- a/packages/react-core/src/components/Hint/__tests__/Hint.test.tsx
+++ b/packages/react-core/src/components/Hint/__tests__/Hint.test.tsx
@@ -6,12 +6,12 @@ import { HintTitle } from '../HintTitle';
import { HintFooter } from '../HintFooter';
test('simple hint', () => {
- const view = render(
+ const { asFragment } = render(
Title
Body
Footer
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/Hint/__tests__/__snapshots__/Hint.test.tsx.snap b/packages/react-core/src/components/Hint/__tests__/__snapshots__/Hint.test.tsx.snap
index 13d39c9092e..e70e2dc0a55 100644
--- a/packages/react-core/src/components/Hint/__tests__/__snapshots__/Hint.test.tsx.snap
+++ b/packages/react-core/src/components/Hint/__tests__/__snapshots__/Hint.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`simple hint 1`] = `
-
+
@@ -24,5 +24,5 @@ exports[`simple hint 1`] = `
Footer
-
+
`;
diff --git a/packages/react-core/src/components/InputGroup/__tests__/InputGroup.test.tsx b/packages/react-core/src/components/InputGroup/__tests__/InputGroup.test.tsx
index b040974b2eb..a595e8904e5 100644
--- a/packages/react-core/src/components/InputGroup/__tests__/InputGroup.test.tsx
+++ b/packages/react-core/src/components/InputGroup/__tests__/InputGroup.test.tsx
@@ -18,6 +18,6 @@ describe('InputGroup', () => {
);
- expect(screen.getByLabelText('some text').getAttribute('aria-describedby')).toEqual('button-id');
+ expect(screen.getByLabelText('some text')).toHaveAttribute('aria-describedby', 'button-id');
});
});
diff --git a/packages/react-core/src/components/InputGroup/__tests__/InputGroupText.test.tsx b/packages/react-core/src/components/InputGroup/__tests__/InputGroupText.test.tsx
index de445aa93cf..a4ad334dc0e 100644
--- a/packages/react-core/src/components/InputGroup/__tests__/InputGroupText.test.tsx
+++ b/packages/react-core/src/components/InputGroup/__tests__/InputGroupText.test.tsx
@@ -1,7 +1,6 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
-import '@testing-library/jest-dom';
import { InputGroupText, InputGroupTextVariant } from '../InputGroupText';
diff --git a/packages/react-core/src/components/JumpLinks/__tests__/JumpLinks.test.tsx b/packages/react-core/src/components/JumpLinks/__tests__/JumpLinks.test.tsx
index 1f41ba70aec..705d27a572b 100644
--- a/packages/react-core/src/components/JumpLinks/__tests__/JumpLinks.test.tsx
+++ b/packages/react-core/src/components/JumpLinks/__tests__/JumpLinks.test.tsx
@@ -5,51 +5,51 @@ import { JumpLinksItem } from '../JumpLinksItem';
import { JumpLinksList } from '../JumpLinksList';
test('simple jumplinks', () => {
- const view = render(
+ const { asFragment } = render(
Inactive section
Active section
Inactive section
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('jumplinks centered', () => {
- const view = render(
+ const { asFragment } = render(
Inactive section
Active section
Inactive section
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('jumplinks with label', () => {
- const view = render(
+ const { asFragment } = render(
Inactive section
Active section
Inactive section
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('vertical with label', () => {
- const view = render(
+ const { asFragment } = render(
Inactive section
Active section
Inactive section
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('expandable vertical with subsection', () => {
- const view = render(
+ const { asFragment } = render(
Inactive section
@@ -64,5 +64,5 @@ test('expandable vertical with subsection', () => {
Inactive section
);
- expect(view.container).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
diff --git a/packages/react-core/src/components/JumpLinks/__tests__/__snapshots__/JumpLinks.test.tsx.snap b/packages/react-core/src/components/JumpLinks/__tests__/__snapshots__/JumpLinks.test.tsx.snap
index 66186fe296d..a31adaba723 100644
--- a/packages/react-core/src/components/JumpLinks/__tests__/__snapshots__/JumpLinks.test.tsx.snap
+++ b/packages/react-core/src/components/JumpLinks/__tests__/__snapshots__/JumpLinks.test.tsx.snap
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`expandable vertical with subsection 1`] = `
-
+
@@ -159,11 +157,11 @@ exports[`expandable vertical with subsection 1`] = `
-
+
`;
exports[`jumplinks centered 1`] = `
-
+
-
+
`;
exports[`jumplinks with label 1`] = `
-
+
-
+
`;
exports[`simple jumplinks 1`] = `
-
+
-
+
`;
exports[`vertical with label 1`] = `
-
+
-
+
`;
diff --git a/packages/react-core/src/components/Label/__tests__/Label.test.tsx b/packages/react-core/src/components/Label/__tests__/Label.test.tsx
index 5f34065ce53..dbd6faa529f 100644
--- a/packages/react-core/src/components/Label/__tests__/Label.test.tsx
+++ b/packages/react-core/src/components/Label/__tests__/Label.test.tsx
@@ -2,7 +2,6 @@ import React from 'react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
-import '@testing-library/jest-dom';
import { Label } from '../Label';
@@ -10,116 +9,116 @@ const labelColors = ['blue', 'cyan', 'green', 'orange', 'purple', 'red', 'grey']
describe('Label', () => {
test('renders', () => {
- render();
- expect(screen.getByTestId('label-test-id').outerHTML).toMatchSnapshot();
+ const { asFragment } = render();
+ expect(asFragment()).toMatchSnapshot();
});
test('renders with outline variant', () => {
- render(
+ const { asFragment } = render(
);
- expect(screen.getByTestId('label-test-id').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('renders with isCompact', () => {
- render(
+ const { asFragment } = render(
);
- expect(screen.getByTestId('label-test-id').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('label with href', () => {
- render(
+ const { asFragment } = render(
);
- expect(screen.getByTestId('label-test-id').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('label with href with outline variant', () => {
- render(
+ const { asFragment } = render(
);
- expect(screen.getByTestId('label-test-id').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('label with close button', () => {
- render(
+ const { asFragment } = render(
);
- expect(screen.getByTestId('label-test-id').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('label with close button and outline variant', () => {
- render(
+ const { asFragment } = render(
);
- expect(screen.getByTestId('label-test-id').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
labelColors.forEach((color: string) =>
test(`label with ${color} color`, () => {
- render(
+ const { asFragment } = render(
);
- expect(screen.getByTestId('label-test-id').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
})
);
labelColors.forEach((color: string) =>
test(`label with ${color} color with outline variant`, () => {
- render(
+ const { asFragment } = render(
);
- expect(screen.getByTestId('label-test-id').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
})
);
test('label with additional class name', () => {
- render(
+ const { asFragment } = render(
);
- expect(screen.getByTestId('label-test-id').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('label with additional class name and props', () => {
- render(
+ const { asFragment } = render(
);
- expect(screen.getByTestId('label-test-id').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('label with truncation', () => {
- render(
+ const { asFragment } = render(
);
- expect(screen.getByTestId('label-test-id').outerHTML).toMatchSnapshot();
+ expect(asFragment()).toMatchSnapshot();
});
test('editable label', () => {
- render(
+ const { asFragment } = render(