-
Notifications
You must be signed in to change notification settings - Fork 274
/
QuickOpenEventuallyCompletesTest.re
44 lines (38 loc) · 1.16 KB
/
QuickOpenEventuallyCompletesTest.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
open Oni_Model;
open Oni_IntegrationTestLib;
runTest(~name="QuickOpen eventually completes", (dispatch, wait, runEffects) => {
wait(~name="Initial mode is normal", (state: State.t) =>
Feature_Vim.mode(state.vim) == Vim.Mode.Normal
);
/* Switch to root directory */
let _: Vim.Context.t =
if (Revery.Environment.os == Revery.Environment.Mac) {
// CI machines timeout with '/' - so we'll use home (which also reproduces the crash)
Vim.command(
"cd ~",
);
} else {
Vim.command("cd /");
};
/* Launch quick open */
dispatch(QuickmenuShow(FilesPicker));
runEffects();
/* Wait for quickmenu 'isLoading' to be true */
wait(~name="Quickmenu is open", (state: State.t) =>
switch (state.quickmenu) {
| Some(_) => true
| _ => false
}
);
let longWaitTime = 10. *. 60.; /* 10 minutes */
/* Wait for quickmenu 'isLoading' to eventually be false - this means quickopen completed w/o crashing */
wait(
~name="Quickmenu is loading is false",
~timeout=longWaitTime,
(state: State.t) => {
switch (state.quickmenu) {
| Some({filterProgress: Complete, _}) => true
| _ => false
}
});
});