@@ -12,32 +12,53 @@ describe("appearance page", () => {
12
12
jest . spyOn ( API , "updateAppearanceSettings" ) . mockResolvedValueOnce ( {
13
13
...MockUser ,
14
14
theme_preference : "dark" ,
15
- terminal_font : "" ,
15
+ terminal_font : "fira-code " ,
16
16
} ) ;
17
17
18
18
const dark = await screen . findByText ( "Dark" ) ;
19
19
await userEvent . click ( dark ) ;
20
20
21
21
// Check if the API was called correctly
22
- expect ( API . updateAppearanceSettings ) . toBeCalledTimes ( 0 ) ;
22
+ expect ( API . updateAppearanceSettings ) . toHaveBeenCalledTimes ( 0 ) ;
23
23
} ) ;
24
24
25
25
it ( "changes theme to light" , async ( ) => {
26
26
renderWithAuth ( < AppearancePage /> ) ;
27
27
28
28
jest . spyOn ( API , "updateAppearanceSettings" ) . mockResolvedValueOnce ( {
29
29
...MockUser ,
30
+ terminal_font : "ibm-plex-mono" ,
30
31
theme_preference : "light" ,
31
- terminal_font : "" ,
32
32
} ) ;
33
33
34
34
const light = await screen . findByText ( "Light" ) ;
35
35
await userEvent . click ( light ) ;
36
36
37
37
// Check if the API was called correctly
38
- expect ( API . updateAppearanceSettings ) . toBeCalledTimes ( 1 ) ;
38
+ expect ( API . updateAppearanceSettings ) . toHaveBeenCalledTimes ( 1 ) ;
39
39
expect ( API . updateAppearanceSettings ) . toHaveBeenCalledWith ( {
40
+ terminal_font : "ibm-plex-mono" ,
40
41
theme_preference : "light" ,
41
42
} ) ;
42
43
} ) ;
44
+
45
+ it ( "changes font to fira code" , async ( ) => {
46
+ renderWithAuth ( < AppearancePage /> ) ;
47
+
48
+ jest . spyOn ( API , "updateAppearanceSettings" ) . mockResolvedValueOnce ( {
49
+ ...MockUser ,
50
+ terminal_font : "fira-code" ,
51
+ theme_preference : "dark" ,
52
+ } ) ;
53
+
54
+ const ibmPlex = await screen . findByText ( "Fira Code" ) ;
55
+ await userEvent . click ( ibmPlex ) ;
56
+
57
+ // Check if the API was called correctly
58
+ expect ( API . updateAppearanceSettings ) . toHaveBeenCalledTimes ( 1 ) ;
59
+ expect ( API . updateAppearanceSettings ) . toHaveBeenCalledWith ( {
60
+ terminal_font : "fira-code" ,
61
+ theme_preference : "dark" ,
62
+ } ) ;
63
+ } ) ;
43
64
} ) ;
0 commit comments