add simple test for onDidChangeVisibleTextEditors, #643

This commit is contained in:
Johannes Rieken
2016-10-13 10:22:26 +02:00
parent 3ac84ba23e
commit 5f0ba23b69

View File

@@ -45,6 +45,33 @@ suite('window namespace tests', () => {
});
});
test('editor, onDidChangeVisibleTextEditors', () => {
let eventCounter = 0;
let reg = window.onDidChangeVisibleTextEditors(editor => {
eventCounter += 1;
});
return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc => {
return window.showTextDocument(doc, ViewColumn.One).then(editor => {
assert.equal(eventCounter, 1);
return doc;
});
}).then(doc => {
return window.showTextDocument(doc, ViewColumn.Two).then(editor => {
assert.equal(eventCounter, 2);
return doc;
});
}).then(doc => {
return window.showTextDocument(doc, ViewColumn.Three).then(editor => {
assert.equal(eventCounter, 3);
return doc;
});
}).then(doc => {
reg.dispose();
});
});
test('editor, onDidChangeTextEditorViewColumn', () => {
let actualEvent: TextEditorViewColumnChangeEvent;