Skip to content

Commit

Permalink
Do not set foreground colors of test status bar (#7651)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne authored Sep 30, 2019
1 parent 5244353 commit b3decc0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 1 addition & 0 deletions news/2 Fixes/4387.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not change `foreground` colors in test statusbar.
7 changes: 0 additions & 7 deletions src/client/testing/display/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,31 +80,25 @@ export class TestResultDisplay implements ITestResultDisplay {
// Treat errors as a special case, as we generally wouldn't have any errors
const statusText: string[] = [];
const toolTip: string[] = [];
let foreColor = '';

if (tests.summary.passed > 0) {
statusText.push(`${constants.Octicons.Test_Pass} ${tests.summary.passed}`);
toolTip.push(`${tests.summary.passed} Passed`);
foreColor = '#66ff66';
}
if (tests.summary.skipped > 0) {
statusText.push(`${constants.Octicons.Test_Skip} ${tests.summary.skipped}`);
toolTip.push(`${tests.summary.skipped} Skipped`);
foreColor = '#66ff66';
}
if (tests.summary.failures > 0) {
statusText.push(`${constants.Octicons.Test_Fail} ${tests.summary.failures}`);
toolTip.push(`${tests.summary.failures} Failed`);
foreColor = 'yellow';
}
if (tests.summary.errors > 0) {
statusText.push(`${constants.Octicons.Test_Error} ${tests.summary.errors}`);
toolTip.push(`${tests.summary.errors} Error${tests.summary.errors > 1 ? 's' : ''}`);
foreColor = 'yellow';
}
this.statusBar.tooltip = toolTip.length === 0 ? 'No Tests Ran' : `${toolTip.join(', ')} (Tests)`;
this.statusBar.text = statusText.length === 0 ? 'No Tests Ran' : statusText.join(' ');
this.statusBar.color = foreColor;
this.statusBar.command = constants.Commands.Tests_View_UI;
this.didChange.fire();
if (statusText.length === 0 && !debug) {
Expand Down Expand Up @@ -193,7 +187,6 @@ export class TestResultDisplay implements ITestResultDisplay {
this.statusBar.tooltip = 'Discover Tests';
this.statusBar.command = constants.Commands.Tests_Discover;
this.statusBar.show();
this.statusBar.color = 'yellow';
if (reason !== CANCELLATION_REASON) {
this.statusBar.text = '$(alert) Test discovery failed';
this.statusBar.tooltip = 'Discovering Tests failed (view \'Python Test Log\' output panel for details)';
Expand Down

0 comments on commit b3decc0

Please sign in to comment.