@theia/test 1.45.1 → 1.46.0-next.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/constants.d.ts +45 -45
- package/lib/browser/constants.js +17 -17
- package/lib/browser/test-service.d.ts +154 -154
- package/lib/browser/test-service.js +247 -247
- package/lib/browser/view/test-context-key-service.d.ts +7 -7
- package/lib/browser/view/test-context-key-service.js +51 -51
- package/lib/browser/view/test-execution-state-manager.d.ts +13 -13
- package/lib/browser/view/test-execution-state-manager.js +173 -173
- package/lib/browser/view/test-output-ui-model.d.ts +47 -47
- package/lib/browser/view/test-output-ui-model.js +151 -151
- package/lib/browser/view/test-output-view-contribution.d.ts +5 -5
- package/lib/browser/view/test-output-view-contribution.js +47 -47
- package/lib/browser/view/test-output-widget.d.ts +24 -24
- package/lib/browser/view/test-output-widget.js +158 -158
- package/lib/browser/view/test-result-view-contribution.d.ts +5 -5
- package/lib/browser/view/test-result-view-contribution.js +47 -47
- package/lib/browser/view/test-result-widget.d.ts +20 -20
- package/lib/browser/view/test-result-widget.js +108 -108
- package/lib/browser/view/test-run-view-contribution.d.ts +17 -17
- package/lib/browser/view/test-run-view-contribution.js +100 -100
- package/lib/browser/view/test-run-widget.d.ts +58 -58
- package/lib/browser/view/test-run-widget.js +310 -310
- package/lib/browser/view/test-tree-widget.d.ts +67 -67
- package/lib/browser/view/test-tree-widget.js +386 -386
- package/lib/browser/view/test-view-contribution.d.ts +45 -45
- package/lib/browser/view/test-view-contribution.js +288 -288
- package/lib/browser/view/test-view-frontend-module.d.ts +6 -6
- package/lib/browser/view/test-view-frontend-module.js +121 -121
- package/lib/common/collections.d.ts +46 -46
- package/lib/common/collections.js +210 -210
- package/lib/common/tree-delta.d.ts +51 -51
- package/lib/common/tree-delta.js +240 -240
- package/lib/common/tree-delta.spec.d.ts +1 -1
- package/lib/common/tree-delta.spec.js +139 -139
- package/package.json +8 -8
- package/src/browser/constants.ts +71 -71
- package/src/browser/style/index.css +41 -41
- package/src/browser/test-service.ts +355 -355
- package/src/browser/view/test-context-key-service.ts +36 -36
- package/src/browser/view/test-execution-state-manager.ts +147 -147
- package/src/browser/view/test-output-ui-model.ts +156 -156
- package/src/browser/view/test-output-view-contribution.ts +34 -34
- package/src/browser/view/test-output-widget.ts +148 -148
- package/src/browser/view/test-result-view-contribution.ts +34 -34
- package/src/browser/view/test-result-widget.ts +92 -92
- package/src/browser/view/test-run-view-contribution.ts +89 -89
- package/src/browser/view/test-run-widget.tsx +271 -271
- package/src/browser/view/test-tree-widget.tsx +360 -360
- package/src/browser/view/test-view-contribution.ts +300 -300
- package/src/browser/view/test-view-frontend-module.ts +134 -134
- package/src/common/collections.ts +223 -223
- package/src/common/tree-delta.spec.ts +166 -166
- package/src/common/tree-delta.ts +259 -259
|
@@ -1,387 +1,387 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2023 STMicroelectronics and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
27
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
28
|
-
};
|
|
29
|
-
var TestTreeWidget_1;
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.TestTreeWidget = exports.TestTree = exports.TestItemNode = exports.TestControllerNode = exports.TestRoot = void 0;
|
|
32
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
33
|
-
const tree_1 = require("@theia/core/lib/browser/tree");
|
|
34
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
35
|
-
const icon_theme_service_1 = require("@theia/core/lib/browser/icon-theme-service");
|
|
36
|
-
const theming_1 = require("@theia/core/lib/browser/theming");
|
|
37
|
-
const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
|
|
38
|
-
const test_service_1 = require("../test-service");
|
|
39
|
-
const React = require("@theia/core/shared/react");
|
|
40
|
-
const tree_delta_1 = require("../../common/tree-delta");
|
|
41
|
-
const core_1 = require("@theia/core");
|
|
42
|
-
const test_execution_state_manager_1 = require("./test-execution-state-manager");
|
|
43
|
-
const test_output_ui_model_1 = require("./test-output-ui-model");
|
|
44
|
-
const test_view_contribution_1 = require("./test-view-contribution");
|
|
45
|
-
const ROOT_ID = 'TestTree';
|
|
46
|
-
var TestRoot;
|
|
47
|
-
(function (TestRoot) {
|
|
48
|
-
function is(node) {
|
|
49
|
-
return tree_1.CompositeTreeNode.is(node) && node.id === ROOT_ID;
|
|
50
|
-
}
|
|
51
|
-
TestRoot.is = is;
|
|
52
|
-
})(TestRoot = exports.TestRoot || (exports.TestRoot = {}));
|
|
53
|
-
var TestControllerNode;
|
|
54
|
-
(function (TestControllerNode) {
|
|
55
|
-
function is(node) {
|
|
56
|
-
return tree_1.ExpandableTreeNode.is(node) && 'controller' in node;
|
|
57
|
-
}
|
|
58
|
-
TestControllerNode.is = is;
|
|
59
|
-
})(TestControllerNode = exports.TestControllerNode || (exports.TestControllerNode = {}));
|
|
60
|
-
var TestItemNode;
|
|
61
|
-
(function (TestItemNode) {
|
|
62
|
-
function is(node) {
|
|
63
|
-
return tree_1.TreeNode.is(node) && 'testItem' in node;
|
|
64
|
-
}
|
|
65
|
-
TestItemNode.is = is;
|
|
66
|
-
})(TestItemNode = exports.TestItemNode || (exports.TestItemNode = {}));
|
|
67
|
-
let TestTree = class TestTree extends tree_1.TreeImpl {
|
|
68
|
-
constructor() {
|
|
69
|
-
super(...arguments);
|
|
70
|
-
this.controllerListeners = new Map();
|
|
71
|
-
}
|
|
72
|
-
init() {
|
|
73
|
-
this.testService.getControllers().forEach(controller => this.addController(controller));
|
|
74
|
-
this.testService.onControllersChanged(e => {
|
|
75
|
-
var _a, _b;
|
|
76
|
-
(_a = e.removed) === null || _a === void 0 ? void 0 : _a.forEach(controller => {
|
|
77
|
-
var _a;
|
|
78
|
-
(_a = this.controllerListeners.get(controller)) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
79
|
-
});
|
|
80
|
-
(_b = e.added) === null || _b === void 0 ? void 0 : _b.forEach(controller => this.addController(controller));
|
|
81
|
-
this.refresh(this.root);
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
addController(controller) {
|
|
85
|
-
const listeners = new core_1.DisposableCollection();
|
|
86
|
-
this.controllerListeners.set(controller.id, listeners);
|
|
87
|
-
listeners.push(controller.onItemsChanged(delta => {
|
|
88
|
-
this.processDeltas(controller, controller, delta);
|
|
89
|
-
}));
|
|
90
|
-
}
|
|
91
|
-
async resolveChildren(parent) {
|
|
92
|
-
if (TestItemNode.is(parent)) {
|
|
93
|
-
parent.testItem.resolveChildren();
|
|
94
|
-
return Promise.resolve(parent.testItem.tests.map(test => this.createTestNode(parent.controller, parent, test)));
|
|
95
|
-
}
|
|
96
|
-
else if (TestControllerNode.is(parent)) {
|
|
97
|
-
return Promise.resolve(parent.controller.tests.map(test => this.createTestNode(parent.controller, parent, test)));
|
|
98
|
-
}
|
|
99
|
-
else if (TestRoot.is(parent)) {
|
|
100
|
-
return Promise.resolve(this.testService.getControllers().map(controller => this.createControllerNode(parent, controller)));
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
return Promise.resolve([]);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
createControllerNode(parent, controller) {
|
|
107
|
-
const node = {
|
|
108
|
-
id: controller.id,
|
|
109
|
-
name: controller.label,
|
|
110
|
-
controller: controller,
|
|
111
|
-
expanded: false,
|
|
112
|
-
children: [],
|
|
113
|
-
parent: parent
|
|
114
|
-
};
|
|
115
|
-
return node;
|
|
116
|
-
}
|
|
117
|
-
processDeltas(controller, parent, deltas) {
|
|
118
|
-
deltas.forEach(delta => this.processDelta(controller, parent, delta));
|
|
119
|
-
}
|
|
120
|
-
processDelta(controller, parent, delta) {
|
|
121
|
-
if (delta.type === tree_delta_1.DeltaKind.ADDED || delta.type === tree_delta_1.DeltaKind.REMOVED) {
|
|
122
|
-
let node;
|
|
123
|
-
if (parent === controller && delta.path.length === 1) {
|
|
124
|
-
node = this.getNode(this.computeId([controller.id]));
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
const item = this.findInParent(parent, delta.path.slice(0, delta.path.length - 1), 0);
|
|
128
|
-
if (item) {
|
|
129
|
-
node = this.getNode(this.computeId(this.computePath(controller, item)));
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
if (node) {
|
|
133
|
-
this.refresh(node); // we only have composite tree nodes in this tree
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
console.warn('delta for unknown test item');
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
const item = this.findInParent(parent, delta.path, 0);
|
|
141
|
-
if (item) {
|
|
142
|
-
if (delta.type === tree_delta_1.DeltaKind.CHANGED) {
|
|
143
|
-
this.fireChanged();
|
|
144
|
-
}
|
|
145
|
-
if (delta.childDeltas) {
|
|
146
|
-
this.processDeltas(controller, item, delta.childDeltas);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
console.warn('delta for unknown test item');
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
findInParent(root, path, startIndex) {
|
|
155
|
-
if (startIndex >= path.length) {
|
|
156
|
-
return root;
|
|
157
|
-
}
|
|
158
|
-
const child = root.tests.find(candidate => candidate.id === path[startIndex]);
|
|
159
|
-
if (!child) {
|
|
160
|
-
return undefined;
|
|
161
|
-
}
|
|
162
|
-
return this.findInParent(child, path, startIndex + 1);
|
|
163
|
-
}
|
|
164
|
-
computePath(controller, item) {
|
|
165
|
-
const result = [controller.id];
|
|
166
|
-
let current = item;
|
|
167
|
-
while (current) {
|
|
168
|
-
result.unshift(current.id);
|
|
169
|
-
current = current.parent;
|
|
170
|
-
}
|
|
171
|
-
return result;
|
|
172
|
-
}
|
|
173
|
-
computeId(path) {
|
|
174
|
-
return path.map(id => id.replace('/', '//')).join('/');
|
|
175
|
-
}
|
|
176
|
-
createTestNode(controller, parent, test) {
|
|
177
|
-
const previous = this.getNode(test.id);
|
|
178
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
179
|
-
const result = {
|
|
180
|
-
id: this.computeId(this.computePath(controller, test)),
|
|
181
|
-
name: test.label,
|
|
182
|
-
controller: controller,
|
|
183
|
-
testItem: test,
|
|
184
|
-
expanded: tree_1.ExpandableTreeNode.is(previous) ? previous.expanded : undefined,
|
|
185
|
-
selected: false,
|
|
186
|
-
children: [],
|
|
187
|
-
parent: parent
|
|
188
|
-
};
|
|
189
|
-
result.children = test.tests.map(t => this.createTestNode(controller, result, t));
|
|
190
|
-
if (result.children.length === 0 && !test.canResolveChildren) {
|
|
191
|
-
delete result.expanded;
|
|
192
|
-
}
|
|
193
|
-
return result;
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
__decorate([
|
|
197
|
-
(0, inversify_1.inject)(test_service_1.TestService),
|
|
198
|
-
__metadata("design:type", Object)
|
|
199
|
-
], TestTree.prototype, "testService", void 0);
|
|
200
|
-
__decorate([
|
|
201
|
-
(0, inversify_1.postConstruct)(),
|
|
202
|
-
__metadata("design:type", Function),
|
|
203
|
-
__metadata("design:paramtypes", []),
|
|
204
|
-
__metadata("design:returntype", void 0)
|
|
205
|
-
], TestTree.prototype, "init", null);
|
|
206
|
-
TestTree = __decorate([
|
|
207
|
-
(0, inversify_1.injectable)()
|
|
208
|
-
], TestTree);
|
|
209
|
-
exports.TestTree = TestTree;
|
|
210
|
-
let TestTreeWidget = TestTreeWidget_1 = class TestTreeWidget extends tree_1.TreeWidget {
|
|
211
|
-
constructor(props, model, contextMenuRenderer) {
|
|
212
|
-
super(props, model, contextMenuRenderer);
|
|
213
|
-
this.id = TestTreeWidget_1.ID;
|
|
214
|
-
this.title.label = core_1.nls.localizeByDefault('Test Explorer');
|
|
215
|
-
this.title.caption = core_1.nls.localizeByDefault('Test Explorer');
|
|
216
|
-
this.title.iconClass = (0, browser_1.codicon)('beaker');
|
|
217
|
-
this.title.closable = true;
|
|
218
|
-
}
|
|
219
|
-
init() {
|
|
220
|
-
super.init();
|
|
221
|
-
this.addClass('theia-test-view');
|
|
222
|
-
this.model.root = {
|
|
223
|
-
id: ROOT_ID,
|
|
224
|
-
parent: undefined,
|
|
225
|
-
visible: false,
|
|
226
|
-
children: []
|
|
227
|
-
};
|
|
228
|
-
this.uiModel.onDidChangeActiveTestRun(e => this.update());
|
|
229
|
-
this.uiModel.onDidChangeActiveTestState(() => this.update());
|
|
230
|
-
this.model.onSelectionChanged(() => {
|
|
231
|
-
const that = this;
|
|
232
|
-
const node = this.model.selectedNodes[0];
|
|
233
|
-
if (TestItemNode.is(node)) {
|
|
234
|
-
const run = that.uiModel.getActiveTestRun(node.controller);
|
|
235
|
-
if (run) {
|
|
236
|
-
const output = run === null || run === void 0 ? void 0 : run.getOutput(node.testItem);
|
|
237
|
-
if (output) {
|
|
238
|
-
this.uiModel.selectedOutputSource = {
|
|
239
|
-
output: output,
|
|
240
|
-
onDidAddTestOutput: core_1.Event.map(run.onDidChangeTestOutput, evt => evt.filter(item => item[0] === node.testItem).map(item => item[1]))
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
this.uiModel.selectedTestState = run.getTestState(node.testItem);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
renderTree(model) {
|
|
249
|
-
if (TestRoot.is(model.root) && model.root.children.length > 0) {
|
|
250
|
-
return super.renderTree(model);
|
|
251
|
-
}
|
|
252
|
-
return React.createElement("div", { className: 'theia-widget-noInfo noMarkers' }, core_1.nls.localizeByDefault('No tests have been found in this workspace yet.'));
|
|
253
|
-
}
|
|
254
|
-
getTestStateClass(state) {
|
|
255
|
-
switch (state) {
|
|
256
|
-
case test_service_1.TestExecutionState.Queued: return `${(0, browser_1.codicon)('history')} queued`;
|
|
257
|
-
case test_service_1.TestExecutionState.Running: return `${(0, browser_1.codicon)('sync')} codicon-modifier-spin running`;
|
|
258
|
-
case test_service_1.TestExecutionState.Skipped: return `${(0, browser_1.codicon)('debug-step-over')} skipped`;
|
|
259
|
-
case test_service_1.TestExecutionState.Failed: return `${(0, browser_1.codicon)('error')} failed`;
|
|
260
|
-
case test_service_1.TestExecutionState.Errored: return `${(0, browser_1.codicon)('issues')} errored`;
|
|
261
|
-
case test_service_1.TestExecutionState.Passed: return `${(0, browser_1.codicon)('pass')} passed`;
|
|
262
|
-
case test_service_1.TestExecutionState.Running: return `${(0, browser_1.codicon)('sync-spin')} running`;
|
|
263
|
-
default: return (0, browser_1.codicon)('circle');
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
renderIcon(node, props) {
|
|
267
|
-
var _a;
|
|
268
|
-
if (TestItemNode.is(node)) {
|
|
269
|
-
const currentRun = this.uiModel.getActiveTestRun(node.controller);
|
|
270
|
-
let state;
|
|
271
|
-
if (currentRun) {
|
|
272
|
-
state = (_a = currentRun.getTestState(node.testItem)) === null || _a === void 0 ? void 0 : _a.state;
|
|
273
|
-
if (!state) {
|
|
274
|
-
state = this.stateManager.getComputedState(currentRun, node.testItem);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
return React.createElement("div", { className: this.getTestStateClass(state) });
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
return super.renderIcon(node, props);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
renderTailDecorations(node, props) {
|
|
284
|
-
if (TestItemNode.is(node)) {
|
|
285
|
-
const testItem = node.testItem;
|
|
286
|
-
return this.contextKeys.with({ view: this.id, controllerId: node.controller.id, testId: testItem.id, testItemHasUri: !!testItem.uri }, () => {
|
|
287
|
-
const menu = this.menus.getMenu(test_view_contribution_1.TEST_VIEW_INLINE_MENU);
|
|
288
|
-
const args = [node.testItem];
|
|
289
|
-
const inlineCommands = menu.children.filter((item) => item instanceof core_1.ActionMenuNode);
|
|
290
|
-
const tailDecorations = super.renderTailDecorations(node, props);
|
|
291
|
-
return React.createElement(React.Fragment, null,
|
|
292
|
-
inlineCommands.length > 0 && React.createElement("div", { className: tree_1.TREE_NODE_SEGMENT_CLASS + ' flex' }, inlineCommands.map((item, index) => this.renderInlineCommand(item, index, this.focusService.hasFocus(node), args))),
|
|
293
|
-
tailDecorations !== undefined && React.createElement("div", { className: tree_1.TREE_NODE_SEGMENT_CLASS + ' flex' }, tailDecorations));
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
else {
|
|
297
|
-
return super.renderTailDecorations(node, props);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
301
|
-
renderInlineCommand(actionMenuNode, index, tabbable, args) {
|
|
302
|
-
if (!actionMenuNode.icon || !this.commands.isVisible(actionMenuNode.command, ...args) || (actionMenuNode.when && !this.contextKeys.match(actionMenuNode.when))) {
|
|
303
|
-
return false;
|
|
304
|
-
}
|
|
305
|
-
const className = [tree_1.TREE_NODE_SEGMENT_CLASS, tree_1.TREE_NODE_TAIL_CLASS, actionMenuNode.icon, browser_1.ACTION_ITEM, 'theia-test-tree-inline-action'].join(' ');
|
|
306
|
-
const tabIndex = tabbable ? 0 : undefined;
|
|
307
|
-
const titleString = actionMenuNode.label + this.resolveKeybindingForCommand(actionMenuNode.command);
|
|
308
|
-
return React.createElement("div", { key: index, className: className, title: titleString, tabIndex: tabIndex, onClick: e => {
|
|
309
|
-
e.stopPropagation();
|
|
310
|
-
this.commands.executeCommand(actionMenuNode.command, ...args);
|
|
311
|
-
} });
|
|
312
|
-
}
|
|
313
|
-
resolveKeybindingForCommand(command) {
|
|
314
|
-
let result = '';
|
|
315
|
-
if (command) {
|
|
316
|
-
const bindings = this.keybindings.getKeybindingsForCommand(command);
|
|
317
|
-
let found = false;
|
|
318
|
-
if (bindings && bindings.length > 0) {
|
|
319
|
-
bindings.forEach(binding => {
|
|
320
|
-
if (!found && this.keybindings.isEnabledInScope(binding, this.node)) {
|
|
321
|
-
found = true;
|
|
322
|
-
result = ` (${this.keybindings.acceleratorFor(binding, '+')})`;
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
return result;
|
|
328
|
-
}
|
|
329
|
-
toContextMenuArgs(node) {
|
|
330
|
-
if (TestItemNode.is(node)) {
|
|
331
|
-
return [node.testItem];
|
|
332
|
-
}
|
|
333
|
-
return [];
|
|
334
|
-
}
|
|
335
|
-
storeState() {
|
|
336
|
-
return {}; // don't store any state for now
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
TestTreeWidget.ID = 'test-tree-widget';
|
|
340
|
-
TestTreeWidget.TEST_CONTEXT_MENU = ['RESOURCE_CONTEXT_MENU'];
|
|
341
|
-
__decorate([
|
|
342
|
-
(0, inversify_1.inject)(icon_theme_service_1.IconThemeService),
|
|
343
|
-
__metadata("design:type", icon_theme_service_1.IconThemeService)
|
|
344
|
-
], TestTreeWidget.prototype, "iconThemeService", void 0);
|
|
345
|
-
__decorate([
|
|
346
|
-
(0, inversify_1.inject)(context_key_service_1.ContextKeyService),
|
|
347
|
-
__metadata("design:type", Object)
|
|
348
|
-
], TestTreeWidget.prototype, "contextKeys", void 0);
|
|
349
|
-
__decorate([
|
|
350
|
-
(0, inversify_1.inject)(theming_1.ThemeService),
|
|
351
|
-
__metadata("design:type", theming_1.ThemeService)
|
|
352
|
-
], TestTreeWidget.prototype, "themeService", void 0);
|
|
353
|
-
__decorate([
|
|
354
|
-
(0, inversify_1.inject)(test_execution_state_manager_1.TestExecutionStateManager),
|
|
355
|
-
__metadata("design:type", test_execution_state_manager_1.TestExecutionStateManager)
|
|
356
|
-
], TestTreeWidget.prototype, "stateManager", void 0);
|
|
357
|
-
__decorate([
|
|
358
|
-
(0, inversify_1.inject)(test_output_ui_model_1.TestOutputUIModel),
|
|
359
|
-
__metadata("design:type", test_output_ui_model_1.TestOutputUIModel)
|
|
360
|
-
], TestTreeWidget.prototype, "uiModel", void 0);
|
|
361
|
-
__decorate([
|
|
362
|
-
(0, inversify_1.inject)(core_1.MenuModelRegistry),
|
|
363
|
-
__metadata("design:type", core_1.MenuModelRegistry)
|
|
364
|
-
], TestTreeWidget.prototype, "menus", void 0);
|
|
365
|
-
__decorate([
|
|
366
|
-
(0, inversify_1.inject)(core_1.CommandRegistry),
|
|
367
|
-
__metadata("design:type", core_1.CommandRegistry)
|
|
368
|
-
], TestTreeWidget.prototype, "commands", void 0);
|
|
369
|
-
__decorate([
|
|
370
|
-
(0, inversify_1.inject)(browser_1.KeybindingRegistry),
|
|
371
|
-
__metadata("design:type", browser_1.KeybindingRegistry)
|
|
372
|
-
], TestTreeWidget.prototype, "keybindings", void 0);
|
|
373
|
-
__decorate([
|
|
374
|
-
(0, inversify_1.postConstruct)(),
|
|
375
|
-
__metadata("design:type", Function),
|
|
376
|
-
__metadata("design:paramtypes", []),
|
|
377
|
-
__metadata("design:returntype", void 0)
|
|
378
|
-
], TestTreeWidget.prototype, "init", null);
|
|
379
|
-
TestTreeWidget = TestTreeWidget_1 = __decorate([
|
|
380
|
-
(0, inversify_1.injectable)(),
|
|
381
|
-
__param(0, (0, inversify_1.inject)(tree_1.TreeProps)),
|
|
382
|
-
__param(1, (0, inversify_1.inject)(tree_1.TreeModel)),
|
|
383
|
-
__param(2, (0, inversify_1.inject)(browser_1.ContextMenuRenderer)),
|
|
384
|
-
__metadata("design:paramtypes", [Object, Object, browser_1.ContextMenuRenderer])
|
|
385
|
-
], TestTreeWidget);
|
|
386
|
-
exports.TestTreeWidget = TestTreeWidget;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2023 STMicroelectronics and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
27
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
28
|
+
};
|
|
29
|
+
var TestTreeWidget_1;
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.TestTreeWidget = exports.TestTree = exports.TestItemNode = exports.TestControllerNode = exports.TestRoot = void 0;
|
|
32
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
33
|
+
const tree_1 = require("@theia/core/lib/browser/tree");
|
|
34
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
35
|
+
const icon_theme_service_1 = require("@theia/core/lib/browser/icon-theme-service");
|
|
36
|
+
const theming_1 = require("@theia/core/lib/browser/theming");
|
|
37
|
+
const context_key_service_1 = require("@theia/core/lib/browser/context-key-service");
|
|
38
|
+
const test_service_1 = require("../test-service");
|
|
39
|
+
const React = require("@theia/core/shared/react");
|
|
40
|
+
const tree_delta_1 = require("../../common/tree-delta");
|
|
41
|
+
const core_1 = require("@theia/core");
|
|
42
|
+
const test_execution_state_manager_1 = require("./test-execution-state-manager");
|
|
43
|
+
const test_output_ui_model_1 = require("./test-output-ui-model");
|
|
44
|
+
const test_view_contribution_1 = require("./test-view-contribution");
|
|
45
|
+
const ROOT_ID = 'TestTree';
|
|
46
|
+
var TestRoot;
|
|
47
|
+
(function (TestRoot) {
|
|
48
|
+
function is(node) {
|
|
49
|
+
return tree_1.CompositeTreeNode.is(node) && node.id === ROOT_ID;
|
|
50
|
+
}
|
|
51
|
+
TestRoot.is = is;
|
|
52
|
+
})(TestRoot = exports.TestRoot || (exports.TestRoot = {}));
|
|
53
|
+
var TestControllerNode;
|
|
54
|
+
(function (TestControllerNode) {
|
|
55
|
+
function is(node) {
|
|
56
|
+
return tree_1.ExpandableTreeNode.is(node) && 'controller' in node;
|
|
57
|
+
}
|
|
58
|
+
TestControllerNode.is = is;
|
|
59
|
+
})(TestControllerNode = exports.TestControllerNode || (exports.TestControllerNode = {}));
|
|
60
|
+
var TestItemNode;
|
|
61
|
+
(function (TestItemNode) {
|
|
62
|
+
function is(node) {
|
|
63
|
+
return tree_1.TreeNode.is(node) && 'testItem' in node;
|
|
64
|
+
}
|
|
65
|
+
TestItemNode.is = is;
|
|
66
|
+
})(TestItemNode = exports.TestItemNode || (exports.TestItemNode = {}));
|
|
67
|
+
let TestTree = class TestTree extends tree_1.TreeImpl {
|
|
68
|
+
constructor() {
|
|
69
|
+
super(...arguments);
|
|
70
|
+
this.controllerListeners = new Map();
|
|
71
|
+
}
|
|
72
|
+
init() {
|
|
73
|
+
this.testService.getControllers().forEach(controller => this.addController(controller));
|
|
74
|
+
this.testService.onControllersChanged(e => {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
(_a = e.removed) === null || _a === void 0 ? void 0 : _a.forEach(controller => {
|
|
77
|
+
var _a;
|
|
78
|
+
(_a = this.controllerListeners.get(controller)) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
79
|
+
});
|
|
80
|
+
(_b = e.added) === null || _b === void 0 ? void 0 : _b.forEach(controller => this.addController(controller));
|
|
81
|
+
this.refresh(this.root);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
addController(controller) {
|
|
85
|
+
const listeners = new core_1.DisposableCollection();
|
|
86
|
+
this.controllerListeners.set(controller.id, listeners);
|
|
87
|
+
listeners.push(controller.onItemsChanged(delta => {
|
|
88
|
+
this.processDeltas(controller, controller, delta);
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
async resolveChildren(parent) {
|
|
92
|
+
if (TestItemNode.is(parent)) {
|
|
93
|
+
parent.testItem.resolveChildren();
|
|
94
|
+
return Promise.resolve(parent.testItem.tests.map(test => this.createTestNode(parent.controller, parent, test)));
|
|
95
|
+
}
|
|
96
|
+
else if (TestControllerNode.is(parent)) {
|
|
97
|
+
return Promise.resolve(parent.controller.tests.map(test => this.createTestNode(parent.controller, parent, test)));
|
|
98
|
+
}
|
|
99
|
+
else if (TestRoot.is(parent)) {
|
|
100
|
+
return Promise.resolve(this.testService.getControllers().map(controller => this.createControllerNode(parent, controller)));
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
return Promise.resolve([]);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
createControllerNode(parent, controller) {
|
|
107
|
+
const node = {
|
|
108
|
+
id: controller.id,
|
|
109
|
+
name: controller.label,
|
|
110
|
+
controller: controller,
|
|
111
|
+
expanded: false,
|
|
112
|
+
children: [],
|
|
113
|
+
parent: parent
|
|
114
|
+
};
|
|
115
|
+
return node;
|
|
116
|
+
}
|
|
117
|
+
processDeltas(controller, parent, deltas) {
|
|
118
|
+
deltas.forEach(delta => this.processDelta(controller, parent, delta));
|
|
119
|
+
}
|
|
120
|
+
processDelta(controller, parent, delta) {
|
|
121
|
+
if (delta.type === tree_delta_1.DeltaKind.ADDED || delta.type === tree_delta_1.DeltaKind.REMOVED) {
|
|
122
|
+
let node;
|
|
123
|
+
if (parent === controller && delta.path.length === 1) {
|
|
124
|
+
node = this.getNode(this.computeId([controller.id]));
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
const item = this.findInParent(parent, delta.path.slice(0, delta.path.length - 1), 0);
|
|
128
|
+
if (item) {
|
|
129
|
+
node = this.getNode(this.computeId(this.computePath(controller, item)));
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (node) {
|
|
133
|
+
this.refresh(node); // we only have composite tree nodes in this tree
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
console.warn('delta for unknown test item');
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
const item = this.findInParent(parent, delta.path, 0);
|
|
141
|
+
if (item) {
|
|
142
|
+
if (delta.type === tree_delta_1.DeltaKind.CHANGED) {
|
|
143
|
+
this.fireChanged();
|
|
144
|
+
}
|
|
145
|
+
if (delta.childDeltas) {
|
|
146
|
+
this.processDeltas(controller, item, delta.childDeltas);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
console.warn('delta for unknown test item');
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
findInParent(root, path, startIndex) {
|
|
155
|
+
if (startIndex >= path.length) {
|
|
156
|
+
return root;
|
|
157
|
+
}
|
|
158
|
+
const child = root.tests.find(candidate => candidate.id === path[startIndex]);
|
|
159
|
+
if (!child) {
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
162
|
+
return this.findInParent(child, path, startIndex + 1);
|
|
163
|
+
}
|
|
164
|
+
computePath(controller, item) {
|
|
165
|
+
const result = [controller.id];
|
|
166
|
+
let current = item;
|
|
167
|
+
while (current) {
|
|
168
|
+
result.unshift(current.id);
|
|
169
|
+
current = current.parent;
|
|
170
|
+
}
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
computeId(path) {
|
|
174
|
+
return path.map(id => id.replace('/', '//')).join('/');
|
|
175
|
+
}
|
|
176
|
+
createTestNode(controller, parent, test) {
|
|
177
|
+
const previous = this.getNode(test.id);
|
|
178
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
179
|
+
const result = {
|
|
180
|
+
id: this.computeId(this.computePath(controller, test)),
|
|
181
|
+
name: test.label,
|
|
182
|
+
controller: controller,
|
|
183
|
+
testItem: test,
|
|
184
|
+
expanded: tree_1.ExpandableTreeNode.is(previous) ? previous.expanded : undefined,
|
|
185
|
+
selected: false,
|
|
186
|
+
children: [],
|
|
187
|
+
parent: parent
|
|
188
|
+
};
|
|
189
|
+
result.children = test.tests.map(t => this.createTestNode(controller, result, t));
|
|
190
|
+
if (result.children.length === 0 && !test.canResolveChildren) {
|
|
191
|
+
delete result.expanded;
|
|
192
|
+
}
|
|
193
|
+
return result;
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
__decorate([
|
|
197
|
+
(0, inversify_1.inject)(test_service_1.TestService),
|
|
198
|
+
__metadata("design:type", Object)
|
|
199
|
+
], TestTree.prototype, "testService", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
(0, inversify_1.postConstruct)(),
|
|
202
|
+
__metadata("design:type", Function),
|
|
203
|
+
__metadata("design:paramtypes", []),
|
|
204
|
+
__metadata("design:returntype", void 0)
|
|
205
|
+
], TestTree.prototype, "init", null);
|
|
206
|
+
TestTree = __decorate([
|
|
207
|
+
(0, inversify_1.injectable)()
|
|
208
|
+
], TestTree);
|
|
209
|
+
exports.TestTree = TestTree;
|
|
210
|
+
let TestTreeWidget = TestTreeWidget_1 = class TestTreeWidget extends tree_1.TreeWidget {
|
|
211
|
+
constructor(props, model, contextMenuRenderer) {
|
|
212
|
+
super(props, model, contextMenuRenderer);
|
|
213
|
+
this.id = TestTreeWidget_1.ID;
|
|
214
|
+
this.title.label = core_1.nls.localizeByDefault('Test Explorer');
|
|
215
|
+
this.title.caption = core_1.nls.localizeByDefault('Test Explorer');
|
|
216
|
+
this.title.iconClass = (0, browser_1.codicon)('beaker');
|
|
217
|
+
this.title.closable = true;
|
|
218
|
+
}
|
|
219
|
+
init() {
|
|
220
|
+
super.init();
|
|
221
|
+
this.addClass('theia-test-view');
|
|
222
|
+
this.model.root = {
|
|
223
|
+
id: ROOT_ID,
|
|
224
|
+
parent: undefined,
|
|
225
|
+
visible: false,
|
|
226
|
+
children: []
|
|
227
|
+
};
|
|
228
|
+
this.uiModel.onDidChangeActiveTestRun(e => this.update());
|
|
229
|
+
this.uiModel.onDidChangeActiveTestState(() => this.update());
|
|
230
|
+
this.model.onSelectionChanged(() => {
|
|
231
|
+
const that = this;
|
|
232
|
+
const node = this.model.selectedNodes[0];
|
|
233
|
+
if (TestItemNode.is(node)) {
|
|
234
|
+
const run = that.uiModel.getActiveTestRun(node.controller);
|
|
235
|
+
if (run) {
|
|
236
|
+
const output = run === null || run === void 0 ? void 0 : run.getOutput(node.testItem);
|
|
237
|
+
if (output) {
|
|
238
|
+
this.uiModel.selectedOutputSource = {
|
|
239
|
+
output: output,
|
|
240
|
+
onDidAddTestOutput: core_1.Event.map(run.onDidChangeTestOutput, evt => evt.filter(item => item[0] === node.testItem).map(item => item[1]))
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
this.uiModel.selectedTestState = run.getTestState(node.testItem);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
renderTree(model) {
|
|
249
|
+
if (TestRoot.is(model.root) && model.root.children.length > 0) {
|
|
250
|
+
return super.renderTree(model);
|
|
251
|
+
}
|
|
252
|
+
return React.createElement("div", { className: 'theia-widget-noInfo noMarkers' }, core_1.nls.localizeByDefault('No tests have been found in this workspace yet.'));
|
|
253
|
+
}
|
|
254
|
+
getTestStateClass(state) {
|
|
255
|
+
switch (state) {
|
|
256
|
+
case test_service_1.TestExecutionState.Queued: return `${(0, browser_1.codicon)('history')} queued`;
|
|
257
|
+
case test_service_1.TestExecutionState.Running: return `${(0, browser_1.codicon)('sync')} codicon-modifier-spin running`;
|
|
258
|
+
case test_service_1.TestExecutionState.Skipped: return `${(0, browser_1.codicon)('debug-step-over')} skipped`;
|
|
259
|
+
case test_service_1.TestExecutionState.Failed: return `${(0, browser_1.codicon)('error')} failed`;
|
|
260
|
+
case test_service_1.TestExecutionState.Errored: return `${(0, browser_1.codicon)('issues')} errored`;
|
|
261
|
+
case test_service_1.TestExecutionState.Passed: return `${(0, browser_1.codicon)('pass')} passed`;
|
|
262
|
+
case test_service_1.TestExecutionState.Running: return `${(0, browser_1.codicon)('sync-spin')} running`;
|
|
263
|
+
default: return (0, browser_1.codicon)('circle');
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
renderIcon(node, props) {
|
|
267
|
+
var _a;
|
|
268
|
+
if (TestItemNode.is(node)) {
|
|
269
|
+
const currentRun = this.uiModel.getActiveTestRun(node.controller);
|
|
270
|
+
let state;
|
|
271
|
+
if (currentRun) {
|
|
272
|
+
state = (_a = currentRun.getTestState(node.testItem)) === null || _a === void 0 ? void 0 : _a.state;
|
|
273
|
+
if (!state) {
|
|
274
|
+
state = this.stateManager.getComputedState(currentRun, node.testItem);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return React.createElement("div", { className: this.getTestStateClass(state) });
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
return super.renderIcon(node, props);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
renderTailDecorations(node, props) {
|
|
284
|
+
if (TestItemNode.is(node)) {
|
|
285
|
+
const testItem = node.testItem;
|
|
286
|
+
return this.contextKeys.with({ view: this.id, controllerId: node.controller.id, testId: testItem.id, testItemHasUri: !!testItem.uri }, () => {
|
|
287
|
+
const menu = this.menus.getMenu(test_view_contribution_1.TEST_VIEW_INLINE_MENU);
|
|
288
|
+
const args = [node.testItem];
|
|
289
|
+
const inlineCommands = menu.children.filter((item) => item instanceof core_1.ActionMenuNode);
|
|
290
|
+
const tailDecorations = super.renderTailDecorations(node, props);
|
|
291
|
+
return React.createElement(React.Fragment, null,
|
|
292
|
+
inlineCommands.length > 0 && React.createElement("div", { className: tree_1.TREE_NODE_SEGMENT_CLASS + ' flex' }, inlineCommands.map((item, index) => this.renderInlineCommand(item, index, this.focusService.hasFocus(node), args))),
|
|
293
|
+
tailDecorations !== undefined && React.createElement("div", { className: tree_1.TREE_NODE_SEGMENT_CLASS + ' flex' }, tailDecorations));
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
return super.renderTailDecorations(node, props);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
301
|
+
renderInlineCommand(actionMenuNode, index, tabbable, args) {
|
|
302
|
+
if (!actionMenuNode.icon || !this.commands.isVisible(actionMenuNode.command, ...args) || (actionMenuNode.when && !this.contextKeys.match(actionMenuNode.when))) {
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
305
|
+
const className = [tree_1.TREE_NODE_SEGMENT_CLASS, tree_1.TREE_NODE_TAIL_CLASS, actionMenuNode.icon, browser_1.ACTION_ITEM, 'theia-test-tree-inline-action'].join(' ');
|
|
306
|
+
const tabIndex = tabbable ? 0 : undefined;
|
|
307
|
+
const titleString = actionMenuNode.label + this.resolveKeybindingForCommand(actionMenuNode.command);
|
|
308
|
+
return React.createElement("div", { key: index, className: className, title: titleString, tabIndex: tabIndex, onClick: e => {
|
|
309
|
+
e.stopPropagation();
|
|
310
|
+
this.commands.executeCommand(actionMenuNode.command, ...args);
|
|
311
|
+
} });
|
|
312
|
+
}
|
|
313
|
+
resolveKeybindingForCommand(command) {
|
|
314
|
+
let result = '';
|
|
315
|
+
if (command) {
|
|
316
|
+
const bindings = this.keybindings.getKeybindingsForCommand(command);
|
|
317
|
+
let found = false;
|
|
318
|
+
if (bindings && bindings.length > 0) {
|
|
319
|
+
bindings.forEach(binding => {
|
|
320
|
+
if (!found && this.keybindings.isEnabledInScope(binding, this.node)) {
|
|
321
|
+
found = true;
|
|
322
|
+
result = ` (${this.keybindings.acceleratorFor(binding, '+')})`;
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return result;
|
|
328
|
+
}
|
|
329
|
+
toContextMenuArgs(node) {
|
|
330
|
+
if (TestItemNode.is(node)) {
|
|
331
|
+
return [node.testItem];
|
|
332
|
+
}
|
|
333
|
+
return [];
|
|
334
|
+
}
|
|
335
|
+
storeState() {
|
|
336
|
+
return {}; // don't store any state for now
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
TestTreeWidget.ID = 'test-tree-widget';
|
|
340
|
+
TestTreeWidget.TEST_CONTEXT_MENU = ['RESOURCE_CONTEXT_MENU'];
|
|
341
|
+
__decorate([
|
|
342
|
+
(0, inversify_1.inject)(icon_theme_service_1.IconThemeService),
|
|
343
|
+
__metadata("design:type", icon_theme_service_1.IconThemeService)
|
|
344
|
+
], TestTreeWidget.prototype, "iconThemeService", void 0);
|
|
345
|
+
__decorate([
|
|
346
|
+
(0, inversify_1.inject)(context_key_service_1.ContextKeyService),
|
|
347
|
+
__metadata("design:type", Object)
|
|
348
|
+
], TestTreeWidget.prototype, "contextKeys", void 0);
|
|
349
|
+
__decorate([
|
|
350
|
+
(0, inversify_1.inject)(theming_1.ThemeService),
|
|
351
|
+
__metadata("design:type", theming_1.ThemeService)
|
|
352
|
+
], TestTreeWidget.prototype, "themeService", void 0);
|
|
353
|
+
__decorate([
|
|
354
|
+
(0, inversify_1.inject)(test_execution_state_manager_1.TestExecutionStateManager),
|
|
355
|
+
__metadata("design:type", test_execution_state_manager_1.TestExecutionStateManager)
|
|
356
|
+
], TestTreeWidget.prototype, "stateManager", void 0);
|
|
357
|
+
__decorate([
|
|
358
|
+
(0, inversify_1.inject)(test_output_ui_model_1.TestOutputUIModel),
|
|
359
|
+
__metadata("design:type", test_output_ui_model_1.TestOutputUIModel)
|
|
360
|
+
], TestTreeWidget.prototype, "uiModel", void 0);
|
|
361
|
+
__decorate([
|
|
362
|
+
(0, inversify_1.inject)(core_1.MenuModelRegistry),
|
|
363
|
+
__metadata("design:type", core_1.MenuModelRegistry)
|
|
364
|
+
], TestTreeWidget.prototype, "menus", void 0);
|
|
365
|
+
__decorate([
|
|
366
|
+
(0, inversify_1.inject)(core_1.CommandRegistry),
|
|
367
|
+
__metadata("design:type", core_1.CommandRegistry)
|
|
368
|
+
], TestTreeWidget.prototype, "commands", void 0);
|
|
369
|
+
__decorate([
|
|
370
|
+
(0, inversify_1.inject)(browser_1.KeybindingRegistry),
|
|
371
|
+
__metadata("design:type", browser_1.KeybindingRegistry)
|
|
372
|
+
], TestTreeWidget.prototype, "keybindings", void 0);
|
|
373
|
+
__decorate([
|
|
374
|
+
(0, inversify_1.postConstruct)(),
|
|
375
|
+
__metadata("design:type", Function),
|
|
376
|
+
__metadata("design:paramtypes", []),
|
|
377
|
+
__metadata("design:returntype", void 0)
|
|
378
|
+
], TestTreeWidget.prototype, "init", null);
|
|
379
|
+
TestTreeWidget = TestTreeWidget_1 = __decorate([
|
|
380
|
+
(0, inversify_1.injectable)(),
|
|
381
|
+
__param(0, (0, inversify_1.inject)(tree_1.TreeProps)),
|
|
382
|
+
__param(1, (0, inversify_1.inject)(tree_1.TreeModel)),
|
|
383
|
+
__param(2, (0, inversify_1.inject)(browser_1.ContextMenuRenderer)),
|
|
384
|
+
__metadata("design:paramtypes", [Object, Object, browser_1.ContextMenuRenderer])
|
|
385
|
+
], TestTreeWidget);
|
|
386
|
+
exports.TestTreeWidget = TestTreeWidget;
|
|
387
387
|
//# sourceMappingURL=test-tree-widget.js.map
|