@@ -5,7 +5,7 @@ describe('Environments', () => {
5
5
let github
6
6
const org = 'bkeepers'
7
7
const repo = 'test'
8
-
8
+
9
9
function fillEnvironment ( attrs ) {
10
10
if ( ! attrs . wait_timer ) attrs . wait_timer = 0 ;
11
11
if ( ! attrs . prevent_self_review ) attrs . prevent_self_review = false ;
@@ -80,7 +80,62 @@ describe('Environments', () => {
80
80
app_id : 1
81
81
}
82
82
]
83
- }
83
+ } ,
84
+ {
85
+ name : 'new-wait-timer' ,
86
+ wait_timer : 1
87
+ } ,
88
+ {
89
+ name : 'new-reviewers' ,
90
+ reviewers : [
91
+ {
92
+ type : 'User' ,
93
+ id : 1
94
+ } ,
95
+ {
96
+ type : 'Team' ,
97
+ id : 2
98
+ }
99
+ ]
100
+ } ,
101
+ {
102
+ name : 'new-prevent-self-review' ,
103
+ prevent_self_review : true
104
+ } ,
105
+ {
106
+ name : 'new-deployment-branch-policy' ,
107
+ deployment_branch_policy : {
108
+ protected_branches : true ,
109
+ custom_branch_policies : false
110
+ }
111
+ } ,
112
+ {
113
+ name : 'new-deployment-branch-policy-custom' ,
114
+ deployment_branch_policy : {
115
+ protected_branches : false ,
116
+ custom_branch_policies : [
117
+ 'master' ,
118
+ 'dev'
119
+ ]
120
+ }
121
+ } ,
122
+ {
123
+ name : 'new-variables' ,
124
+ variables : [
125
+ {
126
+ name : 'test' ,
127
+ value : 'test'
128
+ }
129
+ ]
130
+ } ,
131
+ {
132
+ name : 'new-deployment-protection-rules' ,
133
+ deployment_protection_rules : [
134
+ {
135
+ app_id : 1
136
+ }
137
+ ]
138
+ } ,
84
139
] , {
85
140
debug : function ( ) { }
86
141
} ) ;
@@ -121,7 +176,7 @@ describe('Environments', () => {
121
176
]
122
177
}
123
178
} ) ;
124
-
179
+
125
180
[ 'wait-timer' , 'reviewers' , 'prevent-self-review' , 'deployment-branch-policy' , 'deployment-branch-policy-custom' , 'variables' , 'deployment-protection-rules' ] . forEach ( ( environment_name ) => {
126
181
when ( github . request )
127
182
. calledWith ( 'GET /repos/:org/:repo/environments/:environment_name/variables' , { org, repo, environment_name } )
@@ -139,7 +194,7 @@ describe('Environments', () => {
139
194
data : {
140
195
custom_deployment_protection_rules : [ ]
141
196
}
142
- } )
197
+ } )
143
198
} ) ;
144
199
145
200
when ( github . request )
@@ -271,4 +326,4 @@ describe('Environments', () => {
271
326
} ) ) ;
272
327
} )
273
328
} )
274
- } )
329
+ } )
0 commit comments