@theia/api-tests 1.23.0-next.0 → 1.23.0-next.4

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.23.0-next.0+edeee9cfae1",
3
+ "version": "1.23.0-next.4+d5bb4e83123",
4
4
  "description": "Theia API tests",
5
5
  "dependencies": {
6
- "@theia/core": "1.23.0-next.0+edeee9cfae1"
6
+ "@theia/core": "1.23.0-next.4+d5bb4e83123"
7
7
  },
8
8
  "license": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0",
9
9
  "repository": {
@@ -20,5 +20,5 @@
20
20
  "publishConfig": {
21
21
  "access": "public"
22
22
  },
23
- "gitHead": "edeee9cfae17e46a0c244b5e7b63de479e3d8031"
23
+ "gitHead": "d5bb4e83123d30894871eb96cb6b11ce70aeac45"
24
24
  }
@@ -33,6 +33,7 @@ describe('Saveable', function () {
33
33
  const { Disposable, DisposableCollection } = require('@theia/core/lib/common/disposable');
34
34
 
35
35
  const container = window.theia.container;
36
+ /** @type {EditorManager} */
36
37
  const editorManager = container.get(EditorManager);
37
38
  const workspaceService = container.get(WorkspaceService);
38
39
  const fileService = container.get(FileService);
@@ -266,6 +267,17 @@ describe('Saveable', function () {
266
267
  assert.equal(state.value.trimRight(), 'bar', 'fs should be updated');
267
268
  });
268
269
 
270
+ it('no save prompt when multiple editors open for same file', async () => {
271
+ const secondWidget = await editorManager.openToSide(fileUri);
272
+ editor.getControl().setValue('two widgets');
273
+ assert.isTrue(Saveable.isDirty(widget), 'the first widget should be dirty');
274
+ assert.isTrue(Saveable.isDirty(secondWidget), 'the second widget should also be dirty');
275
+ await Promise.resolve(secondWidget.close());
276
+ assert.isTrue(secondWidget.isDisposed, 'the widget should have closed without requesting user action');
277
+ assert.isTrue(Saveable.isDirty(widget), 'the original widget should still be dirty.');
278
+ assert.equal(editor.getControl().getValue(), 'two widgets', 'should still have the same value');
279
+ });
280
+
269
281
  it('normal close', async () => {
270
282
  editor.getControl().setValue('bar');
271
283
  assert.isTrue(Saveable.isDirty(widget), 'should be dirty before before close');