File tree 2 files changed +8
-2
lines changed
arduino-ide-extension/src
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
import type { Mutable } from '@theia/core/lib/common/types' ;
2
+ import { Unknown } from '../nls' ;
2
3
import type { Defined } from '../types' ;
3
4
import { naturalCompare } from '../utils' ;
4
5
import {
@@ -18,7 +19,6 @@ import {
18
19
portProtocolComparator ,
19
20
selectBoard ,
20
21
unconfirmedBoard ,
21
- unknownBoard ,
22
22
notConnected ,
23
23
boardIdentifierLabel ,
24
24
} from './boards-service' ;
@@ -326,7 +326,7 @@ function createBoardListItemLabels(item: BoardListItem): BoardListItemLabels {
326
326
unconfirmedBoard ;
327
327
board = { name, fqbn : undefined } ;
328
328
}
329
- const boardLabel = board ?. name ?? unknownBoard ;
329
+ const boardLabel = board ?. name ?? Unknown ;
330
330
let boardLabelWithFqbn = boardLabel ;
331
331
if ( board ?. fqbn ) {
332
332
boardLabelWithFqbn += ` (${ board . fqbn } )` ;
Original file line number Diff line number Diff line change 1
1
import { expect } from 'chai' ;
2
+ import { Unknown } from '../../common/nls' ;
2
3
import {
3
4
BoardListLabels ,
4
5
createBoardList ,
@@ -322,6 +323,11 @@ describe('board-list', () => {
322
323
expect ( inferredBoard ?. board ) . to . be . deep . equal ( uno ) ;
323
324
} ) ;
324
325
326
+ it ( `should use the '${ Unknown } ' as the board label when no boards were discovered on a detected port` , ( ) => {
327
+ const { items } = createBoardList ( { ...detectedPort ( unoSerialPort ) } ) ;
328
+ expect ( items [ 0 ] . labels . boardLabel ) . to . be . equal ( Unknown ) ;
329
+ } ) ;
330
+
325
331
describe ( 'defaultAction' , ( ) => {
326
332
it ( "'select' should be the default action for identifier boards" , ( ) => {
327
333
const { items } = createBoardList ( {
You can’t perform that action at this time.
0 commit comments