@theia/api-tests 1.55.0-next.4 → 1.55.0
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/package.json +3 -3
- package/src/explorer-open-close.spec.js +0 -18
- package/src/find-replace.spec.js +0 -19
- package/src/scm.spec.js +9 -3
- package/src/typescript.spec.js +36 -4
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/api-tests",
|
|
3
|
-
"version": "1.55.0
|
|
3
|
+
"version": "1.55.0",
|
|
4
4
|
"description": "Theia API tests",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.55.0
|
|
6
|
+
"@theia/core": "1.55.0"
|
|
7
7
|
},
|
|
8
8
|
"license": "EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0",
|
|
9
9
|
"repository": {
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "0e7a523b8e798679d2e098709c63bd7060e54c8a"
|
|
24
24
|
}
|
|
@@ -123,7 +123,6 @@ describe('Explorer and Editor - open and close', function () {
|
|
|
123
123
|
|
|
124
124
|
async function openEditor() {
|
|
125
125
|
await editorManager.open(fileUri, { mode: 'activate' });
|
|
126
|
-
await waitLanguageServerReady();
|
|
127
126
|
const activeEditor = /** @type {MonacoEditor} */ MonacoEditor.get(editorManager.activeEditor);
|
|
128
127
|
assert.isDefined(activeEditor);
|
|
129
128
|
assert.equal(activeEditor.uri.resolveToAbsolute().toString(), fileUri.resolveToAbsolute().toString());
|
|
@@ -135,21 +134,4 @@ describe('Explorer and Editor - open and close', function () {
|
|
|
135
134
|
assert.isUndefined(activeEditor);
|
|
136
135
|
}
|
|
137
136
|
|
|
138
|
-
async function waitLanguageServerReady() {
|
|
139
|
-
// quite a bit of jitter in the "Initializing LS" status bar entry,
|
|
140
|
-
// so we want to read a few times in a row that it's done (undefined)
|
|
141
|
-
const MAX_N = 5
|
|
142
|
-
let n = MAX_N;
|
|
143
|
-
while (n > 0) {
|
|
144
|
-
await pause(1);
|
|
145
|
-
if (progressStatusBarItem.currentProgress) {
|
|
146
|
-
n = MAX_N;
|
|
147
|
-
} else {
|
|
148
|
-
n--;
|
|
149
|
-
}
|
|
150
|
-
if (n < MAX_N) {
|
|
151
|
-
console.debug('n = ' + n);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
137
|
});
|
package/src/find-replace.spec.js
CHANGED
|
@@ -143,28 +143,9 @@ describe('Find and Replace', function () {
|
|
|
143
143
|
|
|
144
144
|
async function openEditor() {
|
|
145
145
|
await editorManager.open(fileUri, { mode: 'activate' });
|
|
146
|
-
await waitLanguageServerReady();
|
|
147
146
|
const activeEditor = /** @type {MonacoEditor} */ MonacoEditor.get(editorManager.activeEditor);
|
|
148
147
|
assert.isDefined(activeEditor);
|
|
149
148
|
// @ts-ignore
|
|
150
149
|
assert.equal(activeEditor.uri.resolveToAbsolute().toString(), fileUri.resolveToAbsolute().toString());
|
|
151
150
|
}
|
|
152
|
-
|
|
153
|
-
async function waitLanguageServerReady() {
|
|
154
|
-
// quite a bit of jitter in the "Initializing LS" status bar entry,
|
|
155
|
-
// so we want to read a few times in a row that it's done (undefined)
|
|
156
|
-
const MAX_N = 5
|
|
157
|
-
let n = MAX_N;
|
|
158
|
-
while (n > 0) {
|
|
159
|
-
await pause(1);
|
|
160
|
-
if (progressStatusBarItem.currentProgress) {
|
|
161
|
-
n = MAX_N;
|
|
162
|
-
} else {
|
|
163
|
-
n--;
|
|
164
|
-
}
|
|
165
|
-
if (n < 5) {
|
|
166
|
-
console.debug('n = ' + n);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
151
|
});
|
package/src/scm.spec.js
CHANGED
|
@@ -14,9 +14,6 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
17
|
// @ts-check
|
|
21
18
|
describe('SCM', function () {
|
|
22
19
|
|
|
@@ -31,6 +28,8 @@ describe('SCM', function () {
|
|
|
31
28
|
const { ScmService } = require('@theia/scm/lib/browser/scm-service');
|
|
32
29
|
const { ScmWidget } = require('@theia/scm/lib/browser/scm-widget');
|
|
33
30
|
const { CommandRegistry } = require('@theia/core/lib/common');
|
|
31
|
+
const { PreferenceService } = require('@theia/core/lib/browser');
|
|
32
|
+
|
|
34
33
|
|
|
35
34
|
/** @type {import('inversify').Container} */
|
|
36
35
|
const container = window['theia'].container;
|
|
@@ -40,6 +39,7 @@ describe('SCM', function () {
|
|
|
40
39
|
const service = container.get(ScmService);
|
|
41
40
|
const commandRegistry = container.get(CommandRegistry);
|
|
42
41
|
const pluginService = container.get(HostedPluginSupport);
|
|
42
|
+
const preferences = container.get(PreferenceService);
|
|
43
43
|
|
|
44
44
|
/** @type {ScmWidget} */
|
|
45
45
|
let scmWidget;
|
|
@@ -81,6 +81,12 @@ describe('SCM', function () {
|
|
|
81
81
|
return success;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
|
|
85
|
+
before(async () => {
|
|
86
|
+
preferences.set('git.autoRepositoryDetection', true);
|
|
87
|
+
preferences.set('git.openRepositoryInParentFolders', 'always');
|
|
88
|
+
});
|
|
89
|
+
|
|
84
90
|
beforeEach(async () => {
|
|
85
91
|
if (!pluginService.getPlugin(gitPluginId)) {
|
|
86
92
|
throw new Error(gitPluginId + ' should be started');
|
package/src/typescript.spec.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
// @ts-check
|
|
18
18
|
describe('TypeScript', function () {
|
|
19
|
-
this.timeout(
|
|
19
|
+
this.timeout(200_000);
|
|
20
20
|
|
|
21
21
|
const { assert } = chai;
|
|
22
22
|
const { timeout } = require('@theia/core/lib/common/promise-util');
|
|
@@ -94,6 +94,24 @@ describe('TypeScript', function () {
|
|
|
94
94
|
await preferences.set('files.autoSave', originalAutoSaveValue);
|
|
95
95
|
})
|
|
96
96
|
|
|
97
|
+
async function waitLanguageServerReady() {
|
|
98
|
+
// quite a bit of jitter in the "Initializing LS" status bar entry,
|
|
99
|
+
// so we want to read a few times in a row that it's done (undefined)
|
|
100
|
+
const MAX_N = 5
|
|
101
|
+
let n = MAX_N;
|
|
102
|
+
while (n > 0) {
|
|
103
|
+
await timeout(1000);
|
|
104
|
+
if (progressStatusBarItem.currentProgress) {
|
|
105
|
+
n = MAX_N;
|
|
106
|
+
} else {
|
|
107
|
+
n--;
|
|
108
|
+
}
|
|
109
|
+
if (n < 5) {
|
|
110
|
+
console.debug('n = ' + n);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
97
115
|
/**
|
|
98
116
|
* @param {Uri.default} uri
|
|
99
117
|
* @param {boolean} preview
|
|
@@ -106,8 +124,8 @@ describe('TypeScript', function () {
|
|
|
106
124
|
// wait till tsserver is running, see:
|
|
107
125
|
// https://github.com/microsoft/vscode/blob/93cbbc5cae50e9f5f5046343c751b6d010468200/extensions/typescript-language-features/src/extension.ts#L98-L103
|
|
108
126
|
await waitForAnimation(() => contextKeyService.match('typescript.isManagedFile'));
|
|
109
|
-
|
|
110
|
-
|
|
127
|
+
|
|
128
|
+
waitLanguageServerReady();
|
|
111
129
|
return /** @type {MonacoEditor} */ (editor);
|
|
112
130
|
}
|
|
113
131
|
|
|
@@ -388,6 +406,14 @@ describe('TypeScript', function () {
|
|
|
388
406
|
assert.isTrue(contextKeyService.match('editorTextFocus'));
|
|
389
407
|
assert.isTrue(contextKeyService.match('suggestWidgetVisible'));
|
|
390
408
|
|
|
409
|
+
|
|
410
|
+
const suggestController = editor.getControl().getContribution('editor.contrib.suggestController');
|
|
411
|
+
|
|
412
|
+
waitForAnimation(() => {
|
|
413
|
+
const content = nodeAsString(suggestController ? ['_widget']?.['_value']?.['element']?.['domNode']);
|
|
414
|
+
return !content.includes('loading');
|
|
415
|
+
});
|
|
416
|
+
|
|
391
417
|
// May need a couple extra "Enter" being sent for the suggest to be accepted
|
|
392
418
|
keybindings.dispatchKeyDown('Enter');
|
|
393
419
|
await waitForAnimation(() => {
|
|
@@ -398,7 +424,7 @@ describe('TypeScript', function () {
|
|
|
398
424
|
return false;
|
|
399
425
|
}
|
|
400
426
|
return true;
|
|
401
|
-
},
|
|
427
|
+
}, 20000, 'Suggest widget has not been dismissed despite attempts to accept suggestion');
|
|
402
428
|
|
|
403
429
|
assert.isTrue(contextKeyService.match('editorTextFocus'));
|
|
404
430
|
assert.isFalse(contextKeyService.match('suggestWidgetVisible'));
|
|
@@ -542,6 +568,7 @@ describe('TypeScript', function () {
|
|
|
542
568
|
});
|
|
543
569
|
|
|
544
570
|
it('editor.action.showHover', async function () {
|
|
571
|
+
|
|
545
572
|
const editor = await openEditor(demoFileUri);
|
|
546
573
|
// class |DemoClass);
|
|
547
574
|
editor.getControl().setPosition({ lineNumber: 8, column: 7 });
|
|
@@ -558,6 +585,11 @@ describe('TypeScript', function () {
|
|
|
558
585
|
assert.isTrue(contextKeyService.match('editorHoverVisible'));
|
|
559
586
|
assert.isTrue(contextKeyService.match('editorTextFocus'));
|
|
560
587
|
|
|
588
|
+
waitForAnimation(() => {
|
|
589
|
+
const content = nodeAsString(hover['_contentWidget']?.['_widget']?.['_hover']?.['contentsDomNode']);
|
|
590
|
+
return !content.includes('loading');
|
|
591
|
+
});
|
|
592
|
+
|
|
561
593
|
assert.deepEqual(nodeAsString(hover['_contentWidget']?.['_widget']?.['_hover']?.['contentsDomNode']).trim(), `
|
|
562
594
|
DIV {
|
|
563
595
|
DIV {
|