forked from onivim/oni2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfigurationInvalidThemeTest.re
45 lines (40 loc) · 1.25 KB
/
ConfigurationInvalidThemeTest.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
open Oni_Core;
open Utility;
open Oni_Model;
open Oni_IntegrationTestLib;
module Buffer = Oni_Core.Buffer;
let configuration = {|
{
"workbench.colorTheme": "very-invalid-theme",
}
|};
runTest(
~configuration=Some(configuration),
~name="ConfigurationInvalidThemeTest (Regression test for #2985)",
({wait, _}) => {
// We should get an error message referencing our very-invalid-theme..
wait(~name="Wait for error message", (state: State.t) => {
state.notifications
|> Feature_Notification.all
|> List.exists(notification => {
Feature_Notification.(
{
notification.kind == Error
&& StringEx.contains(
"very-invalid-theme",
notification.message,
);
}
)
})
});
// But, we should revert to our default laserwave-italic theme. Check one of the colors...
wait(~name="Wait for error message", (state: State.t) => {
let colors = state.colorTheme |> Feature_Theme.colors;
let editorBackgroundColor =
Feature_Theme.Colors.Editor.background.from(colors);
let expectedColor = Revery.Color.hex("#27212e");
expectedColor == editorBackgroundColor;
});
},
);