From 9a87627b455da4666657fb084f51da13ffe56482 Mon Sep 17 00:00:00 2001 From: hrao Date: Wed, 25 Jun 2025 16:21:32 +0530 Subject: [PATCH 1/5] fix: [M3-10177] - Fix columns misalignment in Subnet NodeBalancers Table --- .../src/features/NodeBalancers/VPCPanel.tsx | 9 +- .../VPCDetail/SubnetLinodeActionMenu.test.tsx | 114 ++++++++++++++++++ .../VPCs/VPCDetail/SubnetLinodeActionMenu.tsx | 76 ++++++++++++ .../VPCs/VPCDetail/SubnetLinodeRow.tsx | 44 ++----- .../VPCs/VPCDetail/SubnetNodebalancerRow.tsx | 8 +- 5 files changed, 211 insertions(+), 40 deletions(-) create mode 100644 packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx create mode 100644 packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.tsx diff --git a/packages/manager/src/features/NodeBalancers/VPCPanel.tsx b/packages/manager/src/features/NodeBalancers/VPCPanel.tsx index 02e2662fc30..538e3c4525b 100644 --- a/packages/manager/src/features/NodeBalancers/VPCPanel.tsx +++ b/packages/manager/src/features/NodeBalancers/VPCPanel.tsx @@ -143,9 +143,12 @@ export const VPCPanel = (props: Props) => { placeholder="Subnet" textFieldProps={{ helperText: ( - - The VPC subnet for this NodeBalancer. - + + + Select a subnet in which to allocate the VPC CIDR for + the NodeBalancer. + + ), helperTextPosition: 'top', }} diff --git a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx new file mode 100644 index 00000000000..f6efeaccf7a --- /dev/null +++ b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx @@ -0,0 +1,114 @@ +import { linodeFactory } from '@linode/utilities'; +import { fireEvent } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import * as React from 'react'; + +import { subnetFactory } from 'src/factories'; +import { renderWithTheme } from 'src/utilities/testHelpers'; + +import SubnetLinodeActionMenu from './SubnetLinodeActionMenu'; + +afterEach(() => { + vi.clearAllMocks(); +}); + +const props = { + handlePowerActionsLinode: vi.fn(), + handleUnassignLinode: vi.fn(), + isVPCLKEEnterpriseCluster: false, + linode: linodeFactory.build({ label: 'linode-1' }), + subnet: subnetFactory.build({ label: 'subnet-1' }), + isOffline: false, + showPowerButton: true, +}; + +describe('SubnetActionMenu', () => { + it('should render the subnet action menu', () => { + const { getByLabelText, getByText } = renderWithTheme( + + ); + const actionMenu = getByLabelText( + `Action menu for Linodes in Subnet subnet-1` + ); + fireEvent.click(actionMenu); + getByText('Reboot Linode'); + getByText('Power Off'); + getByText('Unassign Linode'); + }); + + it('should allow the reboot button to be clicked', async () => { + const { getByLabelText, getByText, queryByLabelText } = renderWithTheme( + + ); + const actionMenu = getByLabelText( + `Action menu for Linodes in Subnet subnet-1` + ); + await userEvent.click(actionMenu); + + const rebootButton = getByText('Reboot Linode'); + await userEvent.click(rebootButton); + expect(props.handlePowerActionsLinode).toHaveBeenCalled(); + const tooltipText = queryByLabelText( + 'Linodes assigned to a subnet must be unassigned before the subnet can be deleted.' + ); + expect(tooltipText).not.toBeInTheDocument(); + }); + + it('should allow the Power Off button to be clicked', async () => { + const { getByLabelText, getByText } = renderWithTheme( + + ); + const actionMenu = getByLabelText( + `Action menu for Linodes in Subnet subnet-1` + ); + await userEvent.click(actionMenu); + + const powerOffButton = getByText('Power Off'); + await userEvent.click(powerOffButton); + expect(props.handlePowerActionsLinode).toHaveBeenCalled(); + }); + + it('should allow the Power On button to be clicked', async () => { + const { getByLabelText, getByText } = renderWithTheme( + + ); + const actionMenu = getByLabelText( + `Action menu for Linodes in Subnet subnet-1` + ); + await userEvent.click(actionMenu); + + const powerOnButton = getByText('Power On'); + await userEvent.click(powerOnButton); + expect(props.handlePowerActionsLinode).toHaveBeenCalled(); + }); + + it('should allow the Unassign Linode button to be clicked', async () => { + const { getByLabelText, getByText } = renderWithTheme( + + ); + const actionMenu = getByLabelText( + `Action menu for Linodes in Subnet subnet-1` + ); + await userEvent.click(actionMenu); + + const unassignButton = getByText('Unassign Linode'); + await userEvent.click(unassignButton); + expect(props.handleUnassignLinode).toHaveBeenCalled(); + }); + + it('should disable action buttons if isVPCLKEEnterpriseCluster is true', async () => { + const updatedProps = { ...props, isVPCLKEEnterpriseCluster: true }; + const { getByLabelText, getAllByRole } = renderWithTheme( + + ); + const actionMenu = getByLabelText( + `Action menu for Linodes in Subnet subnet-1` + ); + await userEvent.click(actionMenu); + + const actionButtons = getAllByRole('menuitem'); + actionButtons.forEach((button) => + expect(button).toHaveAttribute('aria-disabled', 'true') + ); + }); +}); diff --git a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.tsx b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.tsx new file mode 100644 index 00000000000..2b1e258a77a --- /dev/null +++ b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.tsx @@ -0,0 +1,76 @@ +import * as React from 'react'; + +import { ActionMenu } from 'src/components/ActionMenu/ActionMenu'; + +import type { Linode, Subnet } from '@linode/api-v4'; +import type { Action as ActionMenuAction } from 'src/components/ActionMenu/ActionMenu'; +import type { Action as PowerAction } from 'src/features/Linodes/PowerActionsDialogOrDrawer'; + +interface SubnetLinodeActionHandlers { + handlePowerActionsLinode: ( + linode: Linode, + action: PowerAction, + subnet: Subnet + ) => void; + handleUnassignLinode: (linode: Linode, subnet?: Subnet) => void; +} + +interface Props extends SubnetLinodeActionHandlers { + isOffline: boolean; + isVPCLKEEnterpriseCluster: boolean; + linode: Linode; + showPowerButton: boolean; + subnet: Subnet; +} + +export const SubnetLinodeActionMenu = (props: Props) => { + const { + handlePowerActionsLinode, + handleUnassignLinode, + isVPCLKEEnterpriseCluster, + isOffline, + subnet, + linode, + showPowerButton, + } = props; + + const actions: ActionMenuAction[] = [ + { + disabled: isVPCLKEEnterpriseCluster, + onClick: () => { + handlePowerActionsLinode(linode, 'Reboot', subnet); + }, + title: 'Reboot Linode', + }, + { + disabled: isVPCLKEEnterpriseCluster, + onClick: () => { + handleUnassignLinode(linode, subnet); + }, + title: 'Unassign Linode', + }, + ]; + + if (showPowerButton) { + actions.splice(1, 0, { + disabled: isVPCLKEEnterpriseCluster, + onClick: () => { + handlePowerActionsLinode( + linode, + isOffline ? 'Power On' : 'Power Off', + subnet + ); + }, + title: isOffline ? 'Power On' : 'Power Off', + }); + } + + return ( + + ); +}; + +export default SubnetLinodeActionMenu; diff --git a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeRow.tsx b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeRow.tsx index 52b4dfc1d13..76eb3914498 100644 --- a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeRow.tsx +++ b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeRow.tsx @@ -6,7 +6,6 @@ import ErrorOutline from '@mui/icons-material/ErrorOutline'; import * as React from 'react'; import type { JSX } from 'react'; -import { InlineMenuAction } from 'src/components/InlineMenuAction/InlineMenuAction'; import { Link } from 'src/components/Link'; import { StatusIcon } from 'src/components/StatusIcon/StatusIcon'; import { TableCell } from 'src/components/TableCell'; @@ -25,6 +24,7 @@ import { getLinodeInterfaceRanges, hasUnrecommendedConfigurationLinodeInterface, } from '../utils'; +import SubnetLinodeActionMenu from './SubnetLinodeActionMenu'; import { StyledWarningIcon } from './SubnetLinodeRow.styles'; import { ConfigInterfaceFirewallCell, @@ -238,35 +238,15 @@ export const SubnetLinodeRow = (props: Props) => { {!isVPCLKEEnterpriseCluster && ( - <> - {isRebootNeeded && ( - { - handlePowerActionsLinode(linode, 'Reboot', subnet); - }} - /> - )} - {showPowerButton && ( - { - handlePowerActionsLinode( - linode, - isOffline ? 'Power On' : 'Power Off', - subnet - ); - }} - /> - )} - handleUnassignLinode(linode, subnet)} - /> - + )} @@ -351,8 +331,8 @@ export const SubnetLinodeTableRowHead = ( VPC IPv4 Ranges - Firewalls + Firewalls - + ); diff --git a/packages/manager/src/features/VPCs/VPCDetail/SubnetNodebalancerRow.tsx b/packages/manager/src/features/VPCs/VPCDetail/SubnetNodebalancerRow.tsx index 71d879baae1..5bf19ae51fe 100644 --- a/packages/manager/src/features/VPCs/VPCDetail/SubnetNodebalancerRow.tsx +++ b/packages/manager/src/features/VPCs/VPCDetail/SubnetNodebalancerRow.tsx @@ -9,7 +9,6 @@ import { Typography } from '@mui/material'; import * as React from 'react'; import { Link } from 'src/components/Link'; -import { StatusIcon } from 'src/components/StatusIcon/StatusIcon'; import { TableCell } from 'src/components/TableCell'; import { TableRow } from 'src/components/TableRow'; @@ -64,8 +63,7 @@ export const SubnetNodeBalancerRow = ({ return ( <> - - {up} up, {down} down + {up} up - {down} down ); }; @@ -167,8 +165,8 @@ export const SubnetNodeBalancerRow = ({ export const SubnetNodebalancerTableRowHead = ( NodeBalancer - Backend Status - VPC IPv4 Range + Backend Status + VPC IPv4 Range Firewalls ); From bd2c691e992f944d1fc6c2e301a7a37f3ba7de48 Mon Sep 17 00:00:00 2001 From: hrao Date: Wed, 25 Jun 2025 17:18:30 +0530 Subject: [PATCH 2/5] linting warnings pfft --- .../features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx index f6efeaccf7a..aabde344c5f 100644 --- a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx +++ b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx @@ -1,5 +1,4 @@ import { linodeFactory } from '@linode/utilities'; -import { fireEvent } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; @@ -23,14 +22,14 @@ const props = { }; describe('SubnetActionMenu', () => { - it('should render the subnet action menu', () => { + it('should render the subnet action menu', async () => { const { getByLabelText, getByText } = renderWithTheme( ); const actionMenu = getByLabelText( `Action menu for Linodes in Subnet subnet-1` ); - fireEvent.click(actionMenu); + await userEvent.click(actionMenu); getByText('Reboot Linode'); getByText('Power Off'); getByText('Unassign Linode'); From 139d4c96921726b099da8c0f7eab8d3d01b70f89 Mon Sep 17 00:00:00 2001 From: hrao Date: Wed, 25 Jun 2025 17:20:26 +0530 Subject: [PATCH 3/5] Added changeset: Fix console error in Create NodeBalancer page and columns misalignment in Subnet NodeBalancers Table --- packages/manager/.changeset/pr-12428-fixed-1750852226481.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 packages/manager/.changeset/pr-12428-fixed-1750852226481.md diff --git a/packages/manager/.changeset/pr-12428-fixed-1750852226481.md b/packages/manager/.changeset/pr-12428-fixed-1750852226481.md new file mode 100644 index 00000000000..cdb5e735fe6 --- /dev/null +++ b/packages/manager/.changeset/pr-12428-fixed-1750852226481.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Fixed +--- + +Fix console error in Create NodeBalancer page and columns misalignment in Subnet NodeBalancers Table ([#12428](https://github.com/linode/manager/pull/12428)) From 5e276ffc98d48c86608ecc1fcfbbe5b7df14f865 Mon Sep 17 00:00:00 2001 From: hrao Date: Mon, 30 Jun 2025 17:54:10 +0530 Subject: [PATCH 4/5] unit test fix --- .../VPCDetail/SubnetLinodeActionMenu.test.tsx | 6 +- .../VPCs/VPCDetail/SubnetLinodeActionMenu.tsx | 30 ++--- .../VPCs/VPCDetail/SubnetLinodeRow.test.tsx | 103 ++++++++++-------- .../VPCs/VPCDetail/SubnetLinodeRow.tsx | 1 + 4 files changed, 77 insertions(+), 63 deletions(-) diff --git a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx index aabde344c5f..289ec96dd8f 100644 --- a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx +++ b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx @@ -18,6 +18,7 @@ const props = { linode: linodeFactory.build({ label: 'linode-1' }), subnet: subnetFactory.build({ label: 'subnet-1' }), isOffline: false, + isRebootNeeded: false, showPowerButton: true, }; @@ -30,21 +31,20 @@ describe('SubnetActionMenu', () => { `Action menu for Linodes in Subnet subnet-1` ); await userEvent.click(actionMenu); - getByText('Reboot Linode'); getByText('Power Off'); getByText('Unassign Linode'); }); it('should allow the reboot button to be clicked', async () => { const { getByLabelText, getByText, queryByLabelText } = renderWithTheme( - + ); const actionMenu = getByLabelText( `Action menu for Linodes in Subnet subnet-1` ); await userEvent.click(actionMenu); - const rebootButton = getByText('Reboot Linode'); + const rebootButton = getByText('Reboot'); await userEvent.click(rebootButton); expect(props.handlePowerActionsLinode).toHaveBeenCalled(); const tooltipText = queryByLabelText( diff --git a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.tsx b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.tsx index 2b1e258a77a..23402e834e8 100644 --- a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.tsx +++ b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.tsx @@ -17,6 +17,7 @@ interface SubnetLinodeActionHandlers { interface Props extends SubnetLinodeActionHandlers { isOffline: boolean; + isRebootNeeded: boolean; isVPCLKEEnterpriseCluster: boolean; linode: Linode; showPowerButton: boolean; @@ -29,30 +30,25 @@ export const SubnetLinodeActionMenu = (props: Props) => { handleUnassignLinode, isVPCLKEEnterpriseCluster, isOffline, + isRebootNeeded, subnet, linode, showPowerButton, } = props; - const actions: ActionMenuAction[] = [ - { + const actions: ActionMenuAction[] = []; + if (isRebootNeeded) { + actions.push({ disabled: isVPCLKEEnterpriseCluster, onClick: () => { handlePowerActionsLinode(linode, 'Reboot', subnet); }, - title: 'Reboot Linode', - }, - { - disabled: isVPCLKEEnterpriseCluster, - onClick: () => { - handleUnassignLinode(linode, subnet); - }, - title: 'Unassign Linode', - }, - ]; + title: 'Reboot', + }); + } if (showPowerButton) { - actions.splice(1, 0, { + actions.push({ disabled: isVPCLKEEnterpriseCluster, onClick: () => { handlePowerActionsLinode( @@ -65,6 +61,14 @@ export const SubnetLinodeActionMenu = (props: Props) => { }); } + actions.push({ + disabled: isVPCLKEEnterpriseCluster, + onClick: () => { + handleUnassignLinode(linode, subnet); + }, + title: 'Unassign Linode', + }); + return ( { it('should display linode label, reboot status, VPC IPv4 address, associated firewalls, IPv4 chip, and Reboot and Unassign buttons', async () => { const linodeFactory1 = linodeFactory.build({ id: 1, label: 'linode-1' }); + const subnetFactory1 = subnetFactory.build({ id: 1, label: 'subnet-1' }); const config = linodeConfigFactory.build({ interfaces: [linodeConfigInterfaceFactoryWithVPC.build({ id: 1 })], }); @@ -82,20 +83,26 @@ describe('SubnetLinodeRow', () => { const handlePowerActionsLinode = vi.fn(); const handleUnassignLinode = vi.fn(); - const { getAllByRole, getAllByText, getByTestId, findByText } = - renderWithTheme( - wrapWithTableBody( - - ) - ); + const { + getAllByRole, + getAllByText, + getByLabelText, + getByTestId, + getByText, + findByText, + } = renderWithTheme( + wrapWithTableBody( + + ) + ); // Loading states should render expect(getByTestId(loadingTestId)).toBeInTheDocument(); @@ -113,13 +120,16 @@ describe('SubnetLinodeRow', () => { const plusChipButton = getAllByRole('button')[1]; expect(plusChipButton).toHaveTextContent('+1'); - const rebootLinodeButton = getAllByRole('button')[2]; - expect(rebootLinodeButton).toHaveTextContent('Reboot'); + const actionMenu = getByLabelText( + `Action menu for Linodes in Subnet ${subnetFactory1.label}` + ); + await userEvent.click(actionMenu); + + const rebootLinodeButton = getByText('Reboot'); await userEvent.click(rebootLinodeButton); expect(handlePowerActionsLinode).toHaveBeenCalled(); - const unassignLinodeButton = getAllByRole('button')[3]; - expect(unassignLinodeButton).toHaveTextContent('Unassign Linode'); + const unassignLinodeButton = getByText('Unassign Linode'); await userEvent.click(unassignLinodeButton); expect(handleUnassignLinode).toHaveBeenCalled(); const firewall = await findByText(mockFirewall0); @@ -179,6 +189,7 @@ describe('SubnetLinodeRow', () => { it('should not display reboot linode button if the linode has all active interfaces', async () => { const linodeFactory1 = linodeFactory.build({ id: 1, label: 'linode-1' }); + const subnetFactory1 = subnetFactory.build({ id: 1, label: 'subnet-1' }); const vpcInterface = linodeConfigInterfaceFactoryWithVPC.build({ active: true, ip_ranges: [], @@ -206,21 +217,22 @@ describe('SubnetLinodeRow', () => { const handleUnassignLinode = vi.fn(); const handlePowerActionsLinode = vi.fn(); - const { getAllByRole, getByTestId } = renderWithTheme( - wrapWithTableBody( - - ) - ); + const { getAllByRole, getByTestId, getByLabelText, getByText } = + renderWithTheme( + wrapWithTableBody( + + ) + ); // Loading state should render expect(getByTestId(loadingTestId)).toBeInTheDocument(); @@ -233,14 +245,15 @@ describe('SubnetLinodeRow', () => { `/linodes/${linodeFactory1.id}` ); - const buttons = getAllByRole('button'); - expect(buttons.length).toEqual(2); - const powerOffButton = buttons[0]; - expect(powerOffButton).toHaveTextContent('Power Off'); + const actionMenu = getByLabelText( + `Action menu for Linodes in Subnet ${subnetFactory1.label}` + ); + await userEvent.click(actionMenu); + + const powerOffButton = getByText('Power Off'); await userEvent.click(powerOffButton); expect(handlePowerActionsLinode).toHaveBeenCalled(); - const unassignLinodeButton = buttons[1]; - expect(unassignLinodeButton).toHaveTextContent('Unassign Linode'); + const unassignLinodeButton = getByText('Unassign Linode'); await userEvent.click(unassignLinodeButton); expect(handleUnassignLinode).toHaveBeenCalled(); }); @@ -296,7 +309,7 @@ describe('SubnetLinodeRow', () => { }); }); - it('should hide in-line action buttons for LKE-E Linodes', async () => { + it('should hide action-menu buttons for LKE-E Linodes', async () => { const linodeFactory1 = linodeFactory.build({ id: 1, label: 'linode-1' }); server.use( @@ -313,7 +326,7 @@ describe('SubnetLinodeRow', () => { const handleUnassignLinode = vi.fn(); const handlePowerActionsLinode = vi.fn(); - const { getByTestId, queryByRole } = renderWithTheme( + const { getByTestId, queryByText } = renderWithTheme( wrapWithTableBody( { expect(getByTestId(loadingTestId)).toBeInTheDocument(); await waitForElementToBeRemoved(getByTestId(loadingTestId)); - const powerOffButton = queryByRole('button', { - name: 'Power Off', - }); + const powerOffButton = queryByText('Power Off'); expect(powerOffButton).not.toBeInTheDocument(); - const unassignLinodeButton = queryByRole('button', { - name: 'Unassign Linode', - }); + const unassignLinodeButton = queryByText('Unassign Linode'); expect(unassignLinodeButton).not.toBeInTheDocument(); }); diff --git a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeRow.tsx b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeRow.tsx index 76eb3914498..2f289b2369d 100644 --- a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeRow.tsx +++ b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeRow.tsx @@ -242,6 +242,7 @@ export const SubnetLinodeRow = (props: Props) => { handlePowerActionsLinode={handlePowerActionsLinode} handleUnassignLinode={handleUnassignLinode} isOffline={isOffline} + isRebootNeeded={isRebootNeeded} isVPCLKEEnterpriseCluster={isVPCLKEEnterpriseCluster} linode={linode} showPowerButton={showPowerButton} From 4c691b7eeb4650151ed21acfcdbbd704a159bab6 Mon Sep 17 00:00:00 2001 From: hrao Date: Tue, 1 Jul 2025 15:42:47 +0530 Subject: [PATCH 5/5] feedback @bnussman-akamai --- .../features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx | 6 +----- .../src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.tsx | 2 -- .../manager/src/features/VPCs/VPCDetail/SubnetLinodeRow.tsx | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx index 289ec96dd8f..74aad6890d2 100644 --- a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx +++ b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.test.tsx @@ -5,11 +5,7 @@ import * as React from 'react'; import { subnetFactory } from 'src/factories'; import { renderWithTheme } from 'src/utilities/testHelpers'; -import SubnetLinodeActionMenu from './SubnetLinodeActionMenu'; - -afterEach(() => { - vi.clearAllMocks(); -}); +import { SubnetLinodeActionMenu } from './SubnetLinodeActionMenu'; const props = { handlePowerActionsLinode: vi.fn(), diff --git a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.tsx b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.tsx index 23402e834e8..3dee84208c6 100644 --- a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.tsx +++ b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeActionMenu.tsx @@ -76,5 +76,3 @@ export const SubnetLinodeActionMenu = (props: Props) => { /> ); }; - -export default SubnetLinodeActionMenu; diff --git a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeRow.tsx b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeRow.tsx index 2f289b2369d..21de6e38f1f 100644 --- a/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeRow.tsx +++ b/packages/manager/src/features/VPCs/VPCDetail/SubnetLinodeRow.tsx @@ -24,7 +24,7 @@ import { getLinodeInterfaceRanges, hasUnrecommendedConfigurationLinodeInterface, } from '../utils'; -import SubnetLinodeActionMenu from './SubnetLinodeActionMenu'; +import { SubnetLinodeActionMenu } from './SubnetLinodeActionMenu'; import { StyledWarningIcon } from './SubnetLinodeRow.styles'; import { ConfigInterfaceFirewallCell,