@@ -22,7 +22,7 @@ func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) {
22
22
23
23
mux .HandleFunc ("/enterprises/e/secret-scanning/alerts" , func (w http.ResponseWriter , r * http.Request ) {
24
24
testMethod (t , r , "GET" )
25
- testFormValues (t , r , values {"state" : "open" , "secret_type" : "mailchimp_api_key" })
25
+ testFormValues (t , r , values {"state" : "open" , "secret_type" : "mailchimp_api_key" , "sort" : "updated" , "direction" : "asc" })
26
26
27
27
fmt .Fprint (w , `[{
28
28
"number": 1,
@@ -45,7 +45,7 @@ func TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) {
45
45
})
46
46
47
47
ctx := context .Background ()
48
- opts := & SecretScanningAlertListOptions {State : "open" , SecretType : "mailchimp_api_key" }
48
+ opts := & SecretScanningAlertListOptions {State : "open" , SecretType : "mailchimp_api_key" , Direction : "asc" , Sort : "updated" }
49
49
50
50
alerts , _ , err := client .SecretScanning .ListAlertsForEnterprise (ctx , "e" , opts )
51
51
if err != nil {
@@ -97,7 +97,7 @@ func TestSecretScanningService_ListAlertsForOrg(t *testing.T) {
97
97
98
98
mux .HandleFunc ("/orgs/o/secret-scanning/alerts" , func (w http.ResponseWriter , r * http.Request ) {
99
99
testMethod (t , r , "GET" )
100
- testFormValues (t , r , values {"state" : "open" , "secret_type" : "mailchimp_api_key" })
100
+ testFormValues (t , r , values {"state" : "open" , "secret_type" : "mailchimp_api_key" , "sort" : "updated" , "direction" : "asc" })
101
101
102
102
fmt .Fprint (w , `[{
103
103
"number": 1,
@@ -115,7 +115,7 @@ func TestSecretScanningService_ListAlertsForOrg(t *testing.T) {
115
115
})
116
116
117
117
ctx := context .Background ()
118
- opts := & SecretScanningAlertListOptions {State : "open" , SecretType : "mailchimp_api_key" }
118
+ opts := & SecretScanningAlertListOptions {State : "open" , SecretType : "mailchimp_api_key" , Direction : "asc" , Sort : "updated" }
119
119
120
120
alerts , _ , err := client .SecretScanning .ListAlertsForOrg (ctx , "o" , opts )
121
121
if err != nil {
@@ -162,7 +162,7 @@ func TestSecretScanningService_ListAlertsForOrgListOptions(t *testing.T) {
162
162
163
163
mux .HandleFunc ("/orgs/o/secret-scanning/alerts" , func (w http.ResponseWriter , r * http.Request ) {
164
164
testMethod (t , r , "GET" )
165
- testFormValues (t , r , values {"state" : "open" , "secret_type" : "mailchimp_api_key" , "per_page" : "1" , "page" : "1" })
165
+ testFormValues (t , r , values {"state" : "open" , "secret_type" : "mailchimp_api_key" , "per_page" : "1" , "page" : "1" , "sort" : "updated" , "direction" : "asc" })
166
166
167
167
fmt .Fprint (w , `[{
168
168
"number": 1,
@@ -182,7 +182,7 @@ func TestSecretScanningService_ListAlertsForOrgListOptions(t *testing.T) {
182
182
ctx := context .Background ()
183
183
184
184
// Testing pagination by index
185
- opts := & SecretScanningAlertListOptions {State : "open" , SecretType : "mailchimp_api_key" , ListOptions : ListOptions {Page : 1 , PerPage : 1 }}
185
+ opts := & SecretScanningAlertListOptions {State : "open" , SecretType : "mailchimp_api_key" , ListOptions : ListOptions {Page : 1 , PerPage : 1 }, Direction : "asc" , Sort : "updated" }
186
186
187
187
alerts , _ , err := client .SecretScanning .ListAlertsForOrg (ctx , "o" , opts )
188
188
if err != nil {
@@ -229,7 +229,7 @@ func TestSecretScanningService_ListAlertsForRepo(t *testing.T) {
229
229
230
230
mux .HandleFunc ("/repos/o/r/secret-scanning/alerts" , func (w http.ResponseWriter , r * http.Request ) {
231
231
testMethod (t , r , "GET" )
232
- testFormValues (t , r , values {"state" : "open" , "secret_type" : "mailchimp_api_key" })
232
+ testFormValues (t , r , values {"state" : "open" , "secret_type" : "mailchimp_api_key" , "sort" : "updated" , "direction" : "asc" })
233
233
234
234
fmt .Fprint (w , `[{
235
235
"number": 1,
@@ -247,7 +247,7 @@ func TestSecretScanningService_ListAlertsForRepo(t *testing.T) {
247
247
})
248
248
249
249
ctx := context .Background ()
250
- opts := & SecretScanningAlertListOptions {State : "open" , SecretType : "mailchimp_api_key" }
250
+ opts := & SecretScanningAlertListOptions {State : "open" , SecretType : "mailchimp_api_key" , Direction : "asc" , Sort : "updated" }
251
251
252
252
alerts , _ , err := client .SecretScanning .ListAlertsForRepo (ctx , "o" , "r" , opts )
253
253
if err != nil {
0 commit comments