Skip to content

Commit

Permalink
add simple test for onDidChangeVisibleTextEditors, #643
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Oct 13, 2016
1 parent 3ac84ba commit 5f0ba23
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions extensions/vscode-api-tests/src/window.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5f0ba23

Please sign in to comment.