Skip to content

Commit

Permalink
local tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
haberdashPI committed Dec 6, 2024
1 parent fcd5d02 commit ac283cb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -482,4 +482,4 @@
"@wdio/spec-reporter": "^8.40.3",
"ts-node": "^10.9.2"
}
}
}
43 changes: 32 additions & 11 deletions test/specs/splitSelections.ux.mts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@wdio/globals';
import 'wdio-vscode-service';
import {cleanWhitespace, setupEditor, storeCoverageStats} from './utils.mts';
import {TextEditor} from 'wdio-vscode-service';
import {sleep, TextEditor} from 'wdio-vscode-service';

describe('Selection splitting', () => {
let editor: TextEditor;
Expand All @@ -12,8 +12,9 @@ describe('Selection splitting', () => {
bill
phill
`);

await editor.moveCursor(1, 1);
await browser.executeWorkbench(async vscode => {
await vscode.commands.executeCommand('editor.action.selectAll');
});
}

it('can split by string', async () => {
Expand All @@ -23,14 +24,18 @@ describe('Selection splitting', () => {
text: ',',
});
});

await sleep(100);
await browser.executeWorkbench(async vscode => {
await vscode.commands.executeCommand('cursorRight');
});
await browser.keys('+');

expect(await editor.getText()).toEqual(
cleanWhitespace(`joe+, boe+, woe
moe+,b foe+,c doe+,d
bill
phill+
`)
phill
+`)
);
});

Expand All @@ -39,6 +44,10 @@ describe('Selection splitting', () => {
await browser.executeWorkbench(async vscode => {
await vscode.commands.executeCommand('selection-utilities.splitByNewline');
});
await sleep(100);
await browser.executeWorkbench(async vscode => {
await vscode.commands.executeCommand('cursorRight');
});

await browser.keys('+');
expect(await editor.getText()).toEqual(
Expand All @@ -57,14 +66,18 @@ describe('Selection splitting', () => {
text: ',[a-z]\\s*',
});
});
await sleep(100);
await browser.executeWorkbench(async vscode => {
await vscode.commands.executeCommand('cursorRight');
});

await browser.keys('+');
expect(await editor.getText()).toEqual(
cleanWhitespace(`joe, boe, woe
moe+,b foe+,c doe+,d
bill
phill+
`)
phill
+`)
);
});

Expand All @@ -75,6 +88,10 @@ describe('Selection splitting', () => {
text: 'oe',
});
});
await sleep(100);
await browser.executeWorkbench(async vscode => {
await vscode.commands.executeCommand('cursorRight');
});

await browser.keys('+');
expect(await editor.getText()).toEqual(
Expand All @@ -90,14 +107,18 @@ describe('Selection splitting', () => {
await setup();
await browser.executeWorkbench(async vscode => {
await vscode.commands.executeCommand('selection-utilities.createByRegex', {
text: 'oe',
text: '[a-z]\\s+',
});
});
await sleep(100);
await browser.executeWorkbench(async vscode => {
await vscode.commands.executeCommand('cursorRight');
});

await browser.keys('+');
expect(await editor.getText()).toEqual(
cleanWhitespace(`joe,+ boe,+ woe
moe,+b foe,+c doe,+d
cleanWhitespace(`joe, boe, woe
moe,b +foe,c +doe,d
bill
phill
`)
Expand Down

0 comments on commit ac283cb

Please sign in to comment.