diff --git a/packages/react/src/__tests__/ActionMenu.test.tsx b/packages/react/src/__tests__/ActionMenu.test.tsx index 8c8d372e403..4f9d4692c7e 100644 --- a/packages/react/src/__tests__/ActionMenu.test.tsx +++ b/packages/react/src/__tests__/ActionMenu.test.tsx @@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event' import axe from 'axe-core' import React from 'react' import theme from '../theme' -import {ActionMenu, ActionList, BaseStyles, ThemeProvider, Button, IconButton} from '..' +import {ActionMenu, ActionList, BaseStyles, Button, IconButton} from '..' import Tooltip from '../Tooltip' import {Tooltip as TooltipV2} from '../TooltipV2/Tooltip' import {behavesAsComponent, checkExports} from '../utils/testing' @@ -13,115 +13,107 @@ import {SearchIcon, KebabHorizontalIcon} from '@primer/octicons-react' function Example(): JSX.Element { return ( - - + + + Toggle Menu + + + New file + + Copy link + Edit file + event.preventDefault()}> + Delete file + + + Github + + + + + + ) +} + +function ExampleWithTooltip(): JSX.Element { + return ( + + Toggle Menu New file - - Copy link - Edit file - event.preventDefault()}> - Delete file - - - Github - - - - ) -} - -function ExampleWithTooltip(): JSX.Element { - return ( - - - - - Toggle Menu - - - New file - - - - - - + + ) } function ExampleWithTooltipV2(actionMenuTrigger: React.ReactElement): JSX.Element { return ( - - - - {actionMenuTrigger} - - - New file - - - - - + + + {actionMenuTrigger} + + + New file + + + + ) } function ExampleWithSubmenus(): JSX.Element { return ( - - - - Toggle Menu - - - New file - - Copy link - Edit file - - Paste - - - Paste special - - - - Paste plain text - Paste formulas - Paste with formatting - - - Paste from - - - - { - /*noop*/ - }} - > - Current clipboard - - History - Another device - - - - - - - - - - - + + + Toggle Menu + + + New file + + Copy link + Edit file + + Paste + + + Paste special + + + + Paste plain text + Paste formulas + Paste with formatting + + + Paste from + + + + { + /*noop*/ + }} + > + Current clipboard + + History + Another device + + + + + + + + + + ) } @@ -200,11 +192,7 @@ describe('ActionMenu', () => { }) it('should be able to select an Item with selectionVariant', async () => { - const component = HTMLRender( - - - , - ) + const component = HTMLRender() const button = component.getByRole('button', {name: /^options/i}) const user = userEvent.setup() @@ -220,11 +208,7 @@ describe('ActionMenu', () => { }) it('should assign the right roles with groups & mixed selectionVariant', async () => { - const component = HTMLRender( - - - , - ) + const component = HTMLRender() const button = component.getByRole('button', { name: 'Group by Stage', @@ -444,27 +428,25 @@ describe('ActionMenu', () => { it('should pass the "id" prop from ActionMenu.Button to the HTML button', async () => { const buttonId = 'toggle-menu-custom-id' const component = HTMLRender( - - - - Toggle Menu - - - New file - - Copy link - Edit file - event.preventDefault()}> - Delete file - - - Github - - - - - - , + + + Toggle Menu + + + New file + + Copy link + Edit file + event.preventDefault()}> + Delete file + + + Github + + + + + , ) const button = component.getByRole('button') @@ -473,29 +455,27 @@ describe('ActionMenu', () => { it('should pass the "id" prop from ActionMenu.Anchor to anchor child', async () => { const buttonId = 'toggle-menu-custom-id' const component = HTMLRender( - - - - - - - - - New file - - Copy link - Edit file - event.preventDefault()}> - Delete file - - - Github - - - - - - , + + + + + + + + New file + + Copy link + Edit file + event.preventDefault()}> + Delete file + + + Github + + + + + , ) const button = component.getByRole('button') @@ -504,24 +484,22 @@ describe('ActionMenu', () => { it('should use the tooltip id to name the menu when the anchor is icon button', async () => { const component = HTMLRender( - - - - - - - - - - alert('Copy link clicked')}> - Copy link - ⌘C - - - - - - , + + + + + + + + + alert('Copy link clicked')}> + Copy link + ⌘C + + + + + , ) const toggleButton = component.getByRole('button', {name: 'More actions'}) @@ -649,19 +627,17 @@ describe('ActionMenu', () => { const mockOnKeyDown = jest.fn() const component = HTMLRender( - - - - Open menu - - - - New file - Copy link - - - - , + + + Open menu + + + + New file + Copy link + + + , ) const user = userEvent.setup() @@ -687,24 +663,17 @@ describe('ActionMenu', () => { const mockOnKeyDown = jest.fn() const component = HTMLRender( - - - - - - - - New file - Copy link - - - - , + + + + + + + New file + Copy link + + + , ) const user = userEvent.setup() @@ -730,21 +699,19 @@ describe('ActionMenu', () => { const mockOnKeyDown = jest.fn() const component = HTMLRender( - - - - - Open menu - - - - - New file - Copy link - - - - , + + + + Open menu + + + + + New file + Copy link + + + , ) const user = userEvent.setup() @@ -770,26 +737,24 @@ describe('ActionMenu', () => { const mockOnKeyDown = jest.fn() const component = HTMLRender( - - - - - - - - - - New file - Copy link - - - - , + + + + + + + + + New file + Copy link + + + , ) const user = userEvent.setup() diff --git a/packages/react/src/__tests__/AnchoredOverlay.test.tsx b/packages/react/src/__tests__/AnchoredOverlay.test.tsx index 761a1597390..075fc1674a9 100644 --- a/packages/react/src/__tests__/AnchoredOverlay.test.tsx +++ b/packages/react/src/__tests__/AnchoredOverlay.test.tsx @@ -4,9 +4,7 @@ import {behavesAsComponent, checkExports} from '../utils/testing' import {render as HTMLRender, fireEvent} from '@testing-library/react' import axe from 'axe-core' import {Button} from '../Button' -import theme from '../theme' import BaseStyles from '../BaseStyles' -import {ThemeProvider} from '../ThemeProvider' type TestComponentSettings = { initiallyOpen?: boolean @@ -35,18 +33,14 @@ const AnchoredOverlayTestComponent = ({ [onCloseCallback], ) return ( - - - } - > - - - - + } + > + + ) } diff --git a/packages/react/src/__tests__/Autocomplete.test.tsx b/packages/react/src/__tests__/Autocomplete.test.tsx index b8778f6ae1d..b011691c7b6 100644 --- a/packages/react/src/__tests__/Autocomplete.test.tsx +++ b/packages/react/src/__tests__/Autocomplete.test.tsx @@ -6,7 +6,6 @@ import Autocomplete from '../Autocomplete' import type {AutocompleteMenuInternalProps, AutocompleteMenuItem} from '../Autocomplete/AutocompleteMenu' import BaseStyles from '../BaseStyles' import theme from '../theme' -import {ThemeProvider} from '../ThemeProvider' import {render} from '../utils/testing' const mockItems = [ @@ -33,19 +32,17 @@ const LabelledAutocomplete = ({ const {['aria-labelledby']: ariaLabelledBy, ...menuPropsRest} = menuProps const {id = 'autocompleteInput', ...inputPropsRest} = inputProps return ( - - - - - - - - - - - + + + + + + + + + ) } diff --git a/packages/react/src/__tests__/LabelGroup.test.tsx b/packages/react/src/__tests__/LabelGroup.test.tsx index 77a89f65581..86c33537c80 100644 --- a/packages/react/src/__tests__/LabelGroup.test.tsx +++ b/packages/react/src/__tests__/LabelGroup.test.tsx @@ -1,15 +1,13 @@ import React from 'react' import {render as HTMLRender, waitFor} from '@testing-library/react' import axe from 'axe-core' -import {LabelGroup, Label, ThemeProvider, BaseStyles} from '..' +import {LabelGroup, Label, BaseStyles} from '..' import {behavesAsComponent, checkExports} from '../utils/testing' import theme from '../theme' import userEvent from '@testing-library/user-event' const ThemeAndStyleContainer: React.FC = ({children}) => ( - - {children} - + {children} ) const AutoTruncateContainer: React.FC = ({children, width}) => (