Skip to content

Commit 2c1d208

Browse files
authored
testing: add test result state to context on test explorer items (microsoft#232187)
1 parent 25ab7b2 commit 2c1d208

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/vs/workbench/contrib/testing/browser/testingExplorerView.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ import { ITestProfileService, canUseProfileWithTest } from '../common/testProfil
6565
import { LiveTestResult, TestResultItemChangeReason } from '../common/testResult.js';
6666
import { ITestResultService } from '../common/testResultService.js';
6767
import { IMainThreadTestCollection, ITestService, testCollectionIsEmpty } from '../common/testService.js';
68-
import { ITestRunProfile, InternalTestItem, TestControllerCapability, TestItemExpandState, TestResultState, TestRunProfileBitset } from '../common/testTypes.js';
68+
import { ITestRunProfile, InternalTestItem, TestControllerCapability, TestItemExpandState, TestResultState, TestRunProfileBitset, testResultStateToContextValues } from '../common/testTypes.js';
6969
import { TestingContextKeys } from '../common/testingContextKeys.js';
7070
import { ITestingContinuousRunService } from '../common/testingContinuousRunService.js';
7171
import { ITestingPeekOpener } from '../common/testingPeekOpener.js';
@@ -1500,14 +1500,14 @@ class TestItemRenderer extends Disposable
15001500
public renderElement(node: ITreeNode<TestItemTreeElement, FuzzyScore>, _depth: number, data: ITestElementTemplateData): void {
15011501
data.elementDisposable.clear();
15021502
data.current = node.element;
1503-
this.fillActionBar(node.element, data);
1504-
15051503

15061504
data.elementDisposable.add(node.element.onChange(() => this._renderElement(node, data)));
15071505
this._renderElement(node, data);
15081506
}
15091507

15101508
public _renderElement(node: ITreeNode<TestItemTreeElement, FuzzyScore>, data: ITestElementTemplateData): void {
1509+
this.fillActionBar(node.element, data);
1510+
15111511
const testHidden = this.testService.excluded.contains(node.element.test);
15121512
data.wrapper.classList.toggle('test-is-hidden', testHidden);
15131513

@@ -1583,6 +1583,12 @@ const getActionableElementActions = (
15831583
], [
15841584
TestingContextKeys.supportsContinuousRun.key,
15851585
supportsCr,
1586+
], [
1587+
TestingContextKeys.testResultOutdated.key,
1588+
element.retired,
1589+
], [
1590+
TestingContextKeys.testResultState.key,
1591+
testResultStateToContextValues[element.state],
15861592
]);
15871593
}
15881594

0 commit comments

Comments
 (0)