(t *testing.T, key string)
| 199 | } |
| 200 | |
| 201 | func taskPluginOptionsHasKey(t *testing.T, key string) bool { |
| 202 | t.Helper() |
| 203 | recorder := httptest.NewRecorder() |
| 204 | context, _ := gin.CreateTestContext(recorder) |
| 205 | context.Request = httptest.NewRequest(http.MethodGet, "/api/task_plugin_options", nil) |
| 206 | GetTaskPluginOptions(context) |
| 207 | var response struct { |
| 208 | Success bool `json:"success"` |
| 209 | Data []struct { |
| 210 | Key string `json:"key"` |
| 211 | } `json:"data"` |
| 212 | } |
| 213 | require.NoError(t, common.Unmarshal(recorder.Body.Bytes(), &response)) |
| 214 | require.True(t, response.Success) |
| 215 | for _, option := range response.Data { |
| 216 | if option.Key == key { |
| 217 | return true |
| 218 | } |
| 219 | } |
| 220 | return false |
| 221 | } |
| 222 | |
| 223 | func TestDisableFactoryPluginPersistsOptionAndHidesFromBindOptions(t *testing.T) { |
| 224 | setupTaskPluginFactoryDisableTest(t) |
no test coverage detected