mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 02:58:31 -05:00
This reverts commit 5d44b6a6a7.
This commit is contained in:
@@ -86,7 +86,7 @@ class MyResourceInput extends ResourceEditorInput { }
|
||||
|
||||
suite('Workbench base editor', () => {
|
||||
|
||||
test('BaseEditor API', async () => {
|
||||
test('BaseEditor API', function () {
|
||||
let e = new MyEditor(NullTelemetryService);
|
||||
let input = new MyOtherInput();
|
||||
let options = new EditorOptions();
|
||||
@@ -94,24 +94,25 @@ suite('Workbench base editor', () => {
|
||||
assert(!e.isVisible());
|
||||
assert(!e.input);
|
||||
assert(!e.options);
|
||||
return e.setInput(input, options, CancellationToken.None).then(() => {
|
||||
assert.strictEqual(input, e.input);
|
||||
assert.strictEqual(options, e.options);
|
||||
|
||||
await e.setInput(input, options, CancellationToken.None);
|
||||
assert.strictEqual(input, e.input);
|
||||
assert.strictEqual(options, e.options);
|
||||
const group = new TestEditorGroup(1);
|
||||
e.setVisible(true, group);
|
||||
assert(e.isVisible());
|
||||
assert.equal(e.group, group);
|
||||
input.onDispose(() => {
|
||||
assert(false);
|
||||
const group = new TestEditorGroup(1);
|
||||
e.setVisible(true, group);
|
||||
assert(e.isVisible());
|
||||
assert.equal(e.group, group);
|
||||
input.onDispose(() => {
|
||||
assert(false);
|
||||
});
|
||||
e.dispose();
|
||||
e.clearInput();
|
||||
e.setVisible(false, group);
|
||||
assert(!e.isVisible());
|
||||
assert(!e.input);
|
||||
assert(!e.options);
|
||||
assert(!e.getControl());
|
||||
});
|
||||
e.dispose();
|
||||
e.clearInput();
|
||||
e.setVisible(false, group);
|
||||
assert(!e.isVisible());
|
||||
assert(!e.input);
|
||||
assert(!e.options);
|
||||
assert(!e.getControl());
|
||||
});
|
||||
|
||||
test('EditorDescriptor', () => {
|
||||
@@ -153,10 +154,10 @@ suite('Workbench base editor', () => {
|
||||
|
||||
let inst = new TestInstantiationService();
|
||||
|
||||
const editor = EditorRegistry.getEditor(inst.createInstance(MyResourceInput, 'fake', '', URI.file('/fake'), undefined))!.instantiate(inst);
|
||||
const editor = EditorRegistry.getEditor(inst.createInstance(MyResourceInput, 'fake', '', URI.file('/fake')))!.instantiate(inst);
|
||||
assert.strictEqual(editor.getId(), 'myEditor');
|
||||
|
||||
const otherEditor = EditorRegistry.getEditor(inst.createInstance(ResourceEditorInput, 'fake', '', URI.file('/fake'), undefined))!.instantiate(inst);
|
||||
const otherEditor = EditorRegistry.getEditor(inst.createInstance(ResourceEditorInput, 'fake', '', URI.file('/fake')))!.instantiate(inst);
|
||||
assert.strictEqual(otherEditor.getId(), 'myOtherEditor');
|
||||
|
||||
(<any>EditorRegistry).setEditors(oldEditors);
|
||||
@@ -172,7 +173,7 @@ suite('Workbench base editor', () => {
|
||||
|
||||
let inst = new TestInstantiationService();
|
||||
|
||||
const editor = EditorRegistry.getEditor(inst.createInstance(MyResourceInput, 'fake', '', URI.file('/fake'), undefined))!.instantiate(inst);
|
||||
const editor = EditorRegistry.getEditor(inst.createInstance(MyResourceInput, 'fake', '', URI.file('/fake')))!.instantiate(inst);
|
||||
assert.strictEqual('myOtherEditor', editor.getId());
|
||||
|
||||
(<any>EditorRegistry).setEditors(oldEditors);
|
||||
|
||||
Reference in New Issue
Block a user