forked from onivim/oni2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExCommandKeybindingWithArgsTest.re
46 lines (40 loc) · 1.09 KB
/
ExCommandKeybindingWithArgsTest.re
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
open Oni_Core;
open Oni_Model;
open Oni_IntegrationTestLib;
let keybindings =
Some(
{|
[
{"key": "kk", "command": ":d 2", "when": "editorTextFocus"}
]
|},
);
runTest(
~keybindings,
~name="ExCommandKeybindingTest",
({dispatch, wait, input, _}) => {
let testFile = getAssetPath("some-test-file.txt");
dispatch(Actions.OpenFileByPath(testFile, SplitDirection.Current, None));
wait(~name="Verify buffer is loaded", (state: State.t) =>
switch (Selectors.getActiveBuffer(state)) {
| Some(buffer) =>
Buffer.getShortFriendlyName(buffer) == Some("some-test-file.txt")
| None => false
}
);
wait(~name="Verify initial line count", (state: State.t) =>
switch (Selectors.getActiveBuffer(state)) {
| Some(buffer) => Buffer.getNumberOfLines(buffer) == 3
| None => false
}
);
input("k");
input("k");
wait(~name="Wait for split to be created", (state: State.t) =>
switch (Selectors.getActiveBuffer(state)) {
| Some(buffer) => Buffer.getNumberOfLines(buffer) == 1
| None => false
}
);
},
);