File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
arduino-ide-extension/src Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 11import type { Mutable } from '@theia/core/lib/common/types' ;
2+ import { Unknown } from '../nls' ;
23import type { Defined } from '../types' ;
34import { naturalCompare } from '../utils' ;
45import {
@@ -18,7 +19,6 @@ import {
1819 portProtocolComparator ,
1920 selectBoard ,
2021 unconfirmedBoard ,
21- unknownBoard ,
2222 notConnected ,
2323 boardIdentifierLabel ,
2424} from './boards-service' ;
@@ -326,7 +326,7 @@ function createBoardListItemLabels(item: BoardListItem): BoardListItemLabels {
326326 unconfirmedBoard ;
327327 board = { name, fqbn : undefined } ;
328328 }
329- const boardLabel = board ?. name ?? unknownBoard ;
329+ const boardLabel = board ?. name ?? Unknown ;
330330 let boardLabelWithFqbn = boardLabel ;
331331 if ( board ?. fqbn ) {
332332 boardLabelWithFqbn += ` (${ board . fqbn } )` ;
Original file line number Diff line number Diff line change 11import { expect } from 'chai' ;
2+ import { Unknown } from '../../common/nls' ;
23import {
34 BoardListLabels ,
45 createBoardList ,
@@ -322,6 +323,11 @@ describe('board-list', () => {
322323 expect ( inferredBoard ?. board ) . to . be . deep . equal ( uno ) ;
323324 } ) ;
324325
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+
325331 describe ( 'defaultAction' , ( ) => {
326332 it ( "'select' should be the default action for identifier boards" , ( ) => {
327333 const { items } = createBoardList ( {
You can’t perform that action at this time.
0 commit comments