a bunch of failing tests

This commit is contained in:
Johannes Rieken
2021-01-29 16:33:25 +01:00
parent 930b5686ff
commit 46cf57b264
17 changed files with 106 additions and 74 deletions

View File

@@ -6,12 +6,15 @@
import * as assert from 'assert';
import { workspace, window, commands, ViewColumn, TextEditorViewColumnChangeEvent, Uri, Selection, Position, CancellationTokenSource, TextEditorSelectionChangeKind, QuickPickItem, TextEditor } from 'vscode';
import { join } from 'path';
import { closeAllEditors, pathEquals, createRandomFile } from '../utils';
import { closeAllEditors, pathEquals, createRandomFile, assertNoRpc } from '../utils';
suite('vscode API - window', () => {
teardown(closeAllEditors);
teardown(async function () {
assertNoRpc();
await closeAllEditors();
});
test('editor, active text editor', async () => {
const doc = await workspace.openTextDocument(join(workspace.rootPath || '', './far.js'));
@@ -429,8 +432,8 @@ suite('vscode API - window', () => {
});
test('showQuickPick, select first two', async function () {
const label = 'showQuickPick, select first two';
let i = 0;
// const label = 'showQuickPick, select first two';
// let i = 0;
const resolves: ((value: string) => void)[] = [];
let done: () => void;
const unexpected = new Promise<void>((resolve, reject) => {
@@ -442,26 +445,26 @@ suite('vscode API - window', () => {
canPickMany: true
});
const first = new Promise(resolve => resolves.push(resolve));
console.log(`${label}: ${++i}`);
// console.log(`${label}: ${++i}`);
await new Promise(resolve => setTimeout(resolve, 100)); // Allow UI to update.
console.log(`${label}: ${++i}`);
// console.log(`${label}: ${++i}`);
await commands.executeCommand('workbench.action.quickOpenSelectNext');
console.log(`${label}: ${++i}`);
// console.log(`${label}: ${++i}`);
assert.equal(await first, 'eins');
console.log(`${label}: ${++i}`);
// console.log(`${label}: ${++i}`);
await commands.executeCommand('workbench.action.quickPickManyToggle');
console.log(`${label}: ${++i}`);
// console.log(`${label}: ${++i}`);
const second = new Promise(resolve => resolves.push(resolve));
await commands.executeCommand('workbench.action.quickOpenSelectNext');
console.log(`${label}: ${++i}`);
// console.log(`${label}: ${++i}`);
assert.equal(await second, 'zwei');
console.log(`${label}: ${++i}`);
// console.log(`${label}: ${++i}`);
await commands.executeCommand('workbench.action.quickPickManyToggle');
console.log(`${label}: ${++i}`);
// console.log(`${label}: ${++i}`);
await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem');
console.log(`${label}: ${++i}`);
// console.log(`${label}: ${++i}`);
assert.deepStrictEqual(await picks, ['eins', 'zwei']);
console.log(`${label}: ${++i}`);
// console.log(`${label}: ${++i}`);
done!();
return unexpected;
});