Skip to content

Commit

Permalink
fix(app): show network ip info if it exists (#13238)
Browse files Browse the repository at this point in the history
shows the robot-reported wifi and ethernet ip info even when the client app is unable to communicate
via that ip
  • Loading branch information
brenthagen authored Aug 4, 2023
1 parent 34a1f33 commit 5cfb86d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export function RobotSettingsNetworking({
</StyledText>
</Flex>
<Box paddingLeft="3.75rem">
{isOT3ConnectedViaWifi ? (
{wifi?.ipAddress != null ? (
<>
<Flex marginBottom={SPACING.spacing24}>
<Flex marginRight={SPACING.spacing8}>
Expand Down Expand Up @@ -214,7 +214,7 @@ export function RobotSettingsNetworking({
</Flex>
<Box paddingLeft="3.75rem">
<Flex gridGap={SPACING.spacing16}>
{isOT3ConnectedViaEthernet ? (
{ethernet?.ipAddress != null ? (
<>
<Flex
flexDirection={DIRECTION_COLUMN}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ describe('RobotSettingsNetworking', () => {
expect(queryByRole('button', { name: 'Disconnect from Wi-Fi' })).toBeNull()
})

it('should not render Wi-Fi mock data and ethernet mock data when discovery client cannot find a healthy robot at its network connection ip addresses', () => {
it('should not render connected check circles when discovery client cannot find a healthy robot at its network connection ip addresses', () => {
when(mockUseWifiList).calledWith(ROBOT_NAME).mockReturnValue(mockWifiList)
when(mockGetRobotAddressesByName)
.calledWith({} as State, ROBOT_NAME)
Expand All @@ -348,18 +348,18 @@ describe('RobotSettingsNetworking', () => {
const [{ getByText, getByTestId, queryByText, queryAllByTestId }] = render()
getByText('Wi-Fi - foo')
getByText('Wired USB')
expect(queryByText('Wireless IP')).toBeNull()
expect(queryByText('Wireless Subnet Mask')).toBeNull()
expect(queryByText('Wireless MAC Address')).toBeNull()
expect(queryByText('127.0.0.100')).toBeNull()
expect(queryByText('255.255.255.230')).toBeNull()
expect(queryByText('WI:FI:00:00:00:00')).toBeNull()
expect(queryByText('Wired IP')).toBeNull()
expect(queryByText('Wired Subnet Mask')).toBeNull()
expect(queryByText('Wired MAC Address')).toBeNull()
expect(queryByText('127.0.0.101')).toBeNull()
expect(queryByText('255.255.255.231')).toBeNull()
expect(queryByText('US:B0:00:00:00:00')).toBeNull()
getByText('Wireless IP')
getByText('Wireless Subnet Mask')
getByText('Wireless MAC Address')
getByText('127.0.0.100')
getByText('255.255.255.230')
getByText('WI:FI:00:00:00:00')
getByText('Wired IP')
getByText('Wired Subnet Mask')
getByText('Wired MAC Address')
getByText('127.0.0.101')
getByText('255.255.255.231')
getByText('US:B0:00:00:00:00')
expect(queryByText('Wi-Fi - bar')).not.toBeInTheDocument()
expect(
getByTestId('RobotSettings_Networking_wifi_icon')
Expand Down

0 comments on commit 5cfb86d

Please sign in to comment.