Skip to content

Commit 3c5753c

Browse files
authored
fix(app): change desktop network icon priority (#13240)
changes the desktop network icon priority to ethernet > wifi > usb closes RQA-1204
1 parent a5303d1 commit 3c5753c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

app/src/organisms/Devices/RobotStatusHeader.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ export function RobotStatusHeader(props: RobotStatusHeaderProps): JSX.Element {
109109

110110
let iconName: IconName | null = null
111111
let tooltipTranslationKey = null
112-
if (isOT3ConnectedViaWifi) {
113-
iconName = 'wifi'
114-
tooltipTranslationKey = 'device_settings:wifi'
115-
} else if (isOT3ConnectedViaEthernet) {
112+
if (isOT3ConnectedViaEthernet) {
116113
iconName = 'ethernet'
117114
tooltipTranslationKey = 'device_settings:ethernet'
115+
} else if (isOT3ConnectedViaWifi) {
116+
iconName = 'wifi'
117+
tooltipTranslationKey = 'device_settings:wifi'
118118
} else if ((local != null && local) || isOT3ConnectedViaUSB) {
119119
iconName = 'usb'
120120
tooltipTranslationKey = 'device_settings:wired_usb'

app/src/organisms/Devices/__tests__/RobotStatusHeader.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ describe('RobotStatusHeader', () => {
177177
)
178178
})
179179

180-
it('renders a wifi icon when connected by wifi and ethernet', () => {
180+
it('renders an ethernet icon when connected by wifi and ethernet', () => {
181181
when(mockGetNetworkInterfaces)
182182
.calledWith({} as State, 'otie')
183183
.mockReturnValue({
@@ -187,20 +187,20 @@ describe('RobotStatusHeader', () => {
187187

188188
const [{ getByLabelText }] = render(props)
189189

190-
getByLabelText('wifi')
190+
getByLabelText('ethernet')
191191
})
192192

193-
it('renders an ethernet icon when only connected by ethernet', () => {
193+
it('renders a wifi icon when only connected by wifi', () => {
194194
when(mockGetNetworkInterfaces)
195195
.calledWith({} as State, 'otie')
196196
.mockReturnValue({
197-
wifi: null,
198-
ethernet: { ipAddress: ETHERNET_IP } as SimpleInterfaceStatus,
197+
wifi: { ipAddress: WIFI_IP } as SimpleInterfaceStatus,
198+
ethernet: null,
199199
})
200200

201201
const [{ getByLabelText }] = render(props)
202202

203-
getByLabelText('ethernet')
203+
getByLabelText('wifi')
204204
})
205205

206206
it('renders a usb icon when only connected locally', () => {

0 commit comments

Comments
 (0)