-
Notifications
You must be signed in to change notification settings - Fork 274
/
Regression2349EnewTest.re
42 lines (33 loc) · 1.22 KB
/
Regression2349EnewTest.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
open Oni_Model;
open Oni_IntegrationTestLib;
runTest(~name="Regression: Command line no completions", (dispatch, wait, _) => {
wait(~name="Initial mode is normal", (state: State.t) =>
Feature_Vim.mode(state.vim) == Vim.Mode.Normal
);
let initialEditorId = ref(None);
wait(~name="Wait for first editor to be created", (state: State.t) => {
let initialEditor = Feature_Layout.activeEditor(state.layout);
initialEditorId := Some(initialEditor |> Feature_Editor.Editor.getId);
true;
});
dispatch(Actions.VimExecuteCommand("enew"));
wait(~name="New editor created", (state: State.t) => {
let currentEditorId =
state.layout
|> Feature_Layout.activeEditor
|> Feature_Editor.Editor.getId;
Some(currentEditorId) != initialEditorId^;
});
wait(~name="New buffer should have filetype plaintext", (state: State.t) => {
let currentBufferId =
state.layout
|> Feature_Layout.activeEditor
|> Feature_Editor.Editor.getBufferId;
let fileTypeString =
state.buffers
|> Feature_Buffers.get(currentBufferId)
|> Option.map(Oni_Core.Buffer.getFileType)
|> Option.map(Oni_Core.Buffer.FileType.toString);
fileTypeString == Some("plaintext");
});
});