Skip to content

Commit

Permalink
editors - add a test for the fix of #136684
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Nov 10, 2021
1 parent bef4dba commit 2b03df8
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,36 @@ suite('EditorService', () => {
visibleEditorChangeListener.dispose();
});

test('openEditor() - same input does not cancel previous one - https://github.com/microsoft/vscode/issues/136684', async () => {
const [, service] = await createEditorService();

let input = new TestFileEditorInput(URI.parse('my://resource-basics'), TEST_EDITOR_INPUT_ID);

let editorP1 = service.openEditor(input, { pinned: true });
let editorP2 = service.openEditor(input, { pinned: true });

let editor1 = await editorP1;
assert.strictEqual(editor1?.input, input);

let editor2 = await editorP2;
assert.strictEqual(editor2?.input, input);

assert.ok(editor2.group);
await editor2.group.closeAllEditors();

input = new TestFileEditorInput(URI.parse('my://resource-basics'), TEST_EDITOR_INPUT_ID);
let inputSame = new TestFileEditorInput(URI.parse('my://resource-basics'), TEST_EDITOR_INPUT_ID);

editorP1 = service.openEditor(input, { pinned: true });
editorP2 = service.openEditor(inputSame, { pinned: true });

editor1 = await editorP1;
assert.strictEqual(editor1?.input, input);

editor2 = await editorP2;
assert.strictEqual(editor2?.input, input);
});

test('openEditor() - locked groups', async () => {
disposables.add(registerTestFileEditor());

Expand Down

0 comments on commit 2b03df8

Please sign in to comment.