Turn back on Linux CI test validation (#14241)

* Turn on Linux CI test validation

* Add checks around a code block raising exceptions in unit tests

* Bump node version to 12

* Add check around classList add
This commit is contained in:
Karl Burtram
2021-02-11 18:59:40 -08:00
committed by GitHub
parent 756454efa9
commit 7739f25f7f
3 changed files with 70 additions and 55 deletions

View File

@@ -313,7 +313,19 @@ export class ActionViewItem extends BaseActionViewItem {
if (this.label) {
this.label.classList.add('codicon');
if (this.cssClass) {
this.label.classList.add(...this.cssClass.split(' '));
// {{SQL CARBON EDIT}} - avoid exception if class contains empty elements
let classList = this.cssClass.split(' ');
let containsEmpty = false;
if (classList && classList.length > 0) {
for (let i = 0; i < classList.length; ++i) {
if (classList[i] === undefined || classList[i] === '') {
containsEmpty = true;
}
}
if (!containsEmpty) {
this.label.classList.add(...this.cssClass.split(' '));
}
}
}
}

View File

@@ -345,7 +345,10 @@ class WelcomePage extends Disposable {
workspaces = workspaces.filter(recent => !this.contextService.isCurrentWorkspace(isRecentWorkspace(recent) ? recent.workspace : recent.folderUri));
if (!workspaces.length) {
const recent = container.querySelector('.welcomePage') as HTMLElement;
recent.classList.add('emptyRecent');
// {{SQL CARBON EDIT}} - avoid unit test null ref
if (recent && recent.classList) {
recent.classList.add('emptyRecent');
}
return;
}
const ul = container.querySelector('.recent ul');