mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
editors - add a test for the fix of #136684
This commit is contained in:
parent
bef4dba21f
commit
2b03df8938
|
@ -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());
|
||||
|
||||
|
|
Loading…
Reference in a new issue