@@ -20,10 +20,12 @@ describe("git-config", async () => {
2020 } ) ;
2121
2222 const resources = state . resources ;
23- expect ( resources ) . toHaveLength ( 3 ) ;
23+ expect ( resources ) . toHaveLength ( 5 ) ;
2424 expect ( resources ) . toMatchObject ( [
2525 { type : "coder_workspace" , name : "me" } ,
26+ { type : "coder_env" , name : "git_author_email" } ,
2627 { type : "coder_env" , name : "git_author_name" } ,
28+ { type : "coder_env" , name : "git_commmiter_email" } ,
2729 { type : "coder_env" , name : "git_commmiter_name" } ,
2830 ] ) ;
2931 } ) ;
@@ -35,12 +37,14 @@ describe("git-config", async () => {
3537 } ) ;
3638
3739 const resources = state . resources ;
38- expect ( resources ) . toHaveLength ( 5 ) ;
40+ expect ( resources ) . toHaveLength ( 7 ) ;
3941 expect ( resources ) . toMatchObject ( [
4042 { type : "coder_parameter" , name : "user_email" } ,
4143 { type : "coder_parameter" , name : "username" } ,
4244 { type : "coder_workspace" , name : "me" } ,
45+ { type : "coder_env" , name : "git_author_email" } ,
4346 { type : "coder_env" , name : "git_author_name" } ,
47+ { type : "coder_env" , name : "git_commmiter_email" } ,
4448 { type : "coder_env" , name : "git_commmiter_name" } ,
4549 ] ) ;
4650 } ) ;
@@ -53,7 +57,7 @@ describe("git-config", async () => {
5357 allow_username_change : "false" ,
5458 allow_email_change : "false" ,
5559 } ,
56- { CODER_WORKSPACE_OWNER_EMAIL : "foo@emai .com" } ,
60+ { CODER_WORKSPACE_OWNER_EMAIL : "foo@email .com" } ,
5761 ) ;
5862
5963 const resources = state . resources ;
@@ -75,12 +79,22 @@ describe("git-config", async () => {
7579 allow_email_change : "true" ,
7680 coder_parameter_order : order . toString ( ) ,
7781 } ) ;
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+ ] ) ;
7993 // 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 ) ;
8195 // username order is incremented by 1
8296 // @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 ) ;
8498 } ) ;
8599
86100 it ( "set custom order for coder_parameter for just username" , async ( ) => {
@@ -91,9 +105,18 @@ describe("git-config", async () => {
91105 allow_username_change : "true" ,
92106 coder_parameter_order : order . toString ( ) ,
93107 } ) ;
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+ ] ) ;
95118 // user_email was not created
96119 // 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 ) ;
98121 } ) ;
99122} ) ;
0 commit comments