@@ -20,10 +20,12 @@ describe("git-config", async () => {
20
20
} ) ;
21
21
22
22
const resources = state . resources ;
23
- expect ( resources ) . toHaveLength ( 3 ) ;
23
+ expect ( resources ) . toHaveLength ( 5 ) ;
24
24
expect ( resources ) . toMatchObject ( [
25
25
{ type : "coder_workspace" , name : "me" } ,
26
+ { type : "coder_env" , name : "git_author_email" } ,
26
27
{ type : "coder_env" , name : "git_author_name" } ,
28
+ { type : "coder_env" , name : "git_commmiter_email" } ,
27
29
{ type : "coder_env" , name : "git_commmiter_name" } ,
28
30
] ) ;
29
31
} ) ;
@@ -35,12 +37,14 @@ describe("git-config", async () => {
35
37
} ) ;
36
38
37
39
const resources = state . resources ;
38
- expect ( resources ) . toHaveLength ( 5 ) ;
40
+ expect ( resources ) . toHaveLength ( 7 ) ;
39
41
expect ( resources ) . toMatchObject ( [
40
42
{ type : "coder_parameter" , name : "user_email" } ,
41
43
{ type : "coder_parameter" , name : "username" } ,
42
44
{ type : "coder_workspace" , name : "me" } ,
45
+ { type : "coder_env" , name : "git_author_email" } ,
43
46
{ type : "coder_env" , name : "git_author_name" } ,
47
+ { type : "coder_env" , name : "git_commmiter_email" } ,
44
48
{ type : "coder_env" , name : "git_commmiter_name" } ,
45
49
] ) ;
46
50
} ) ;
@@ -53,7 +57,7 @@ describe("git-config", async () => {
53
57
allow_username_change : "false" ,
54
58
allow_email_change : "false" ,
55
59
} ,
56
- { CODER_WORKSPACE_OWNER_EMAIL : "foo@emai .com" } ,
60
+ { CODER_WORKSPACE_OWNER_EMAIL : "foo@email .com" } ,
57
61
) ;
58
62
59
63
const resources = state . resources ;
@@ -75,12 +79,22 @@ describe("git-config", async () => {
75
79
allow_email_change : "true" ,
76
80
coder_parameter_order : order . toString ( ) ,
77
81
} ) ;
78
- expect ( state . resources ) . toHaveLength ( 5 ) ;
82
+ const resources = state . resources ;
83
+ expect ( resources ) . toHaveLength ( 7 ) ;
84
+ expect ( resources ) . toMatchObject ( [
85
+ { type : "coder_parameter" , name : "user_email" } ,
86
+ { type : "coder_parameter" , name : "username" } ,
87
+ { type : "coder_workspace" , name : "me" } ,
88
+ { type : "coder_env" , name : "git_author_email" } ,
89
+ { type : "coder_env" , name : "git_author_name" } ,
90
+ { type : "coder_env" , name : "git_commmiter_email" } ,
91
+ { type : "coder_env" , name : "git_commmiter_name" } ,
92
+ ] ) ;
79
93
// user_email order is the same as the order
80
- expect ( state . resources [ 0 ] . instances [ 0 ] . attributes . order ) . toBe ( order ) ;
94
+ expect ( resources [ 0 ] . instances [ 0 ] . attributes . order ) . toBe ( order ) ;
81
95
// username order is incremented by 1
82
96
// @ts -ignore: Object is possibly 'null'.
83
- expect ( state . resources [ 1 ] . instances [ 0 ] ?. attributes . order ) . toBe ( order + 1 ) ;
97
+ expect ( resources [ 1 ] . instances [ 0 ] ?. attributes . order ) . toBe ( order + 1 ) ;
84
98
} ) ;
85
99
86
100
it ( "set custom order for coder_parameter for just username" , async ( ) => {
@@ -91,9 +105,18 @@ describe("git-config", async () => {
91
105
allow_username_change : "true" ,
92
106
coder_parameter_order : order . toString ( ) ,
93
107
} ) ;
94
- expect ( state . resources ) . toHaveLength ( 4 ) ;
108
+ const resources = state . resources ;
109
+ expect ( resources ) . toHaveLength ( 6 ) ;
110
+ expect ( resources ) . toMatchObject ( [
111
+ { type : "coder_parameter" , name : "username" } ,
112
+ { type : "coder_workspace" , name : "me" } ,
113
+ { type : "coder_env" , name : "git_author_email" } ,
114
+ { type : "coder_env" , name : "git_author_name" } ,
115
+ { type : "coder_env" , name : "git_commmiter_email" } ,
116
+ { type : "coder_env" , name : "git_commmiter_name" } ,
117
+ ] ) ;
95
118
// user_email was not created
96
119
// username order is incremented by 1
97
- expect ( state . resources [ 0 ] . instances [ 0 ] . attributes . order ) . toBe ( order + 1 ) ;
120
+ expect ( resources [ 0 ] . instances [ 0 ] . attributes . order ) . toBe ( order + 1 ) ;
98
121
} ) ;
99
122
} ) ;
0 commit comments