@theia/api-tests 1.50.1 → 1.52.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 CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@theia/api-tests",
3
- "version": "1.50.1",
3
+ "version": "1.52.0",
4
4
  "description": "Theia API tests",
5
5
  "dependencies": {
6
- "@theia/core": "1.50.1"
6
+ "@theia/core": "1.52.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": "ffefc7ac2c0f6c63256042b7710551304200e5e1"
23
+ "gitHead": "40ceebcd4ee75f13ec16b9dc7314e9384493c1ac"
24
24
  }
package/src/menus.spec.js CHANGED
@@ -44,8 +44,8 @@ describe('Menus', function () {
44
44
 
45
45
  const container = window.theia.container;
46
46
  const shell = container.get(ApplicationShell);
47
+ /** @type {BrowserMenuBarContribution} */
47
48
  const menuBarContribution = container.get(BrowserMenuBarContribution);
48
- const menuBar = /** @type {import('@theia/core/lib/browser/menu/browser-menu-plugin').MenuBarWidget} */ (menuBarContribution.menuBar);
49
49
  const pluginService = container.get(HostedPluginSupport);
50
50
  const menus = container.get(MenuModelRegistry);
51
51
  const commands = container.get(CommandRegistry);
@@ -54,6 +54,9 @@ describe('Menus', function () {
54
54
  before(async function () {
55
55
  await pluginService.didStart;
56
56
  await pluginService.activateByViewContainer('explorer');
57
+ // Updating the menu interferes with our ability to programmatically test it
58
+ // We simply disable the menu updating
59
+ menus.isReady = false;
57
60
  });
58
61
 
59
62
  const toTearDown = new DisposableCollection();
@@ -73,7 +76,7 @@ describe('Menus', function () {
73
76
  ]) {
74
77
  it(`should toggle '${contribution.viewLabel}' view`, async () => {
75
78
  await contribution.closeView();
76
- await menuBar.triggerMenuItem('View', contribution.viewLabel);
79
+ await menuBarContribution.menuBar.triggerMenuItem('View', contribution.viewLabel);
77
80
  await shell.waitForActivation(contribution.viewId);
78
81
  });
79
82
  }
@@ -103,10 +103,9 @@ describe('TypeScript', function () {
103
103
  const editorWidget = widget instanceof EditorWidget ? widget : undefined;
104
104
  const editor = MonacoEditor.get(editorWidget);
105
105
  assert.isDefined(editor);
106
- await timeout(1000); // workaround for https://github.com/eclipse-theia/theia/issues/13679
107
106
  // wait till tsserver is running, see:
108
107
  // https://github.com/microsoft/vscode/blob/93cbbc5cae50e9f5f5046343c751b6d010468200/extensions/typescript-language-features/src/extension.ts#L98-L103
109
- // await waitForAnimation(() => contextKeyService.match('typescript.isManagedFile'));
108
+ await waitForAnimation(() => contextKeyService.match('typescript.isManagedFile'));
110
109
  // https://github.com/microsoft/vscode/blob/4aac84268c6226d23828cc6a1fe45ee3982927f0/extensions/typescript-language-features/src/typescriptServiceClient.ts#L911
111
110
  await waitForAnimation(() => !progressStatusBarItem.currentProgress);
112
111
  return /** @type {MonacoEditor} */ (editor);
package/src/views.spec.js CHANGED
@@ -14,6 +14,8 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
+ const { timeout } = require('@theia/core/lib/common/promise-util');
18
+
17
19
  // @ts-check
18
20
  describe('Views', function () {
19
21
  this.timeout(7500);
@@ -52,24 +54,26 @@ describe('Views', function () {
52
54
  if (view) {
53
55
  assert.notEqual(shell.getAreaFor(view), contribution.defaultViewOptions.area);
54
56
  assert.isFalse(view.isVisible);
55
- assert.notEqual(view, shell.activeWidget);
57
+ assert.isTrue(view !== shell.activeWidget, `${contribution.viewLabel} !== shell.activeWidget`);
56
58
  }
57
59
 
58
60
  view = await contribution.toggleView();
59
- assert.notEqual(view, undefined);
61
+ // we can't use "equals" here because Mocha chokes on the diff for certain widgets
62
+ assert.isTrue(view !== undefined, `${contribution.viewLabel} !== undefined`);
60
63
  assert.equal(shell.getAreaFor(view), contribution.defaultViewOptions.area);
61
64
  assert.isDefined(shell.getTabBarFor(view));
62
65
  // @ts-ignore
63
66
  assert.equal(shell.getAreaFor(shell.getTabBarFor(view)), contribution.defaultViewOptions.area);
64
67
  assert.isTrue(view.isVisible);
65
- assert.equal(view, shell.activeWidget);
68
+ assert.isTrue(view === shell.activeWidget, `${contribution.viewLabel} === shell.activeWidget`);
66
69
 
67
70
  view = await contribution.toggleView();
71
+ await timeout(0); // seems that the "await" is not enought to guarantee that the panel is hidden
68
72
  assert.notEqual(view, undefined);
69
73
  assert.equal(shell.getAreaFor(view), contribution.defaultViewOptions.area);
70
74
  assert.isDefined(shell.getTabBarFor(view));
71
75
  assert.isFalse(view.isVisible);
72
- assert.notEqual(view, shell.activeWidget);
76
+ assert.isTrue(view !== shell.activeWidget, `${contribution.viewLabel} !== shell.activeWidget`);
73
77
  });
74
78
  }
75
79