Skip to content

Commit

Permalink
Use real bracket completion in test instead of edit and move
Browse files Browse the repository at this point in the history
  • Loading branch information
tshino committed Mar 30, 2022
1 parent 3ed104c commit 7b317c3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/suite/playback_typing.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,9 @@ describe('Recording and Playback: Typing', () => {
await setSelections([[4, 13, 4, 19]]); // placeholder 'params'
await vscode.commands.executeCommand('type', { text: 'name' });
await setSelections([[5, 4]]); // inside the function block
await vscode.commands.executeCommand('type', { text: 'console.log(' });
await setSelections([[5, 16]]); // bracket completion
await vscode.commands.executeCommand('type', { text: 'console.log(' }); // triggers bracket completion
await vscode.commands.executeCommand('type', { text: 'name' });
await setSelections([[5, 21]]);
await vscode.commands.executeCommand('type', { text: ')' }); // overwrite closing bracket
await vscode.commands.executeCommand('type', { text: ';' });
keyboardMacro.finishRecording();
assert.deepStrictEqual(getSequence(), [
Expand All @@ -508,8 +507,7 @@ describe('Recording and Playback: Typing', () => {
Type('console.log()'),
MoveLeft(1),
Type('name'),
MoveRight(1),
Type(';')
ReplaceRight(1, ');')
]);
assert.strictEqual(textEditor.document.lineAt(4).text, 'function say(name) {');
assert.strictEqual(textEditor.document.lineAt(5).text, ' console.log(name);');
Expand Down

0 comments on commit 7b317c3

Please sign in to comment.