Skip to content

Commit

Permalink
fix(regression): restore the Unknown board label
Browse files Browse the repository at this point in the history
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
  • Loading branch information
Akos Kitta committed Aug 18, 2023
1 parent 530cddb commit b3b731a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arduino-ide-extension/src/common/protocol/board-list.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Mutable } from '@theia/core/lib/common/types';
import { Unknown } from '../nls';
import type { Defined } from '../types';
import { naturalCompare } from '../utils';
import {
Expand All @@ -18,7 +19,6 @@ import {
portProtocolComparator,
selectBoard,
unconfirmedBoard,
unknownBoard,
notConnected,
boardIdentifierLabel,
} from './boards-service';
Expand Down Expand Up @@ -326,7 +326,7 @@ function createBoardListItemLabels(item: BoardListItem): BoardListItemLabels {
unconfirmedBoard;
board = { name, fqbn: undefined };
}
const boardLabel = board?.name ?? unknownBoard;
const boardLabel = board?.name ?? Unknown;
let boardLabelWithFqbn = boardLabel;
if (board?.fqbn) {
boardLabelWithFqbn += ` (${board.fqbn})`;
Expand Down
6 changes: 6 additions & 0 deletions arduino-ide-extension/src/test/common/board-list.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from 'chai';
import { Unknown } from '../../common/nls';
import {
BoardListLabels,
createBoardList,
Expand Down Expand Up @@ -322,6 +323,11 @@ describe('board-list', () => {
expect(inferredBoard?.board).to.be.deep.equal(uno);
});

it(`should use the '${Unknown}' as the board label when no boards were discovered on a detected port`, () => {
const { items } = createBoardList({ ...detectedPort(unoSerialPort) });
expect(items[0].labels.boardLabel).to.be.equal(Unknown);
});

describe('defaultAction', () => {
it("'select' should be the default action for identifier boards", () => {
const { items } = createBoardList({
Expand Down

0 comments on commit b3b731a

Please sign in to comment.