(data)
| 105 | }; |
| 106 | |
| 107 | const _onTestRequest = (data) => { |
| 108 | const newTestResult = {}; |
| 109 | return dispatch(testRequest({ team_id: team.id, connection: data })) |
| 110 | .then(async (response) => { |
| 111 | newTestResult.status = response.payload.status; |
| 112 | newTestResult.body = await response.payload.text(); |
| 113 | |
| 114 | try { |
| 115 | newTestResult.body = JSON.parse(newTestResult.body); |
| 116 | newTestResult.body = JSON.stringify(newTestResult, null, 2); |
| 117 | } catch (e) { |
| 118 | // the response is not in JSON format |
| 119 | } |
| 120 | |
| 121 | setTestResult(newTestResult); |
| 122 | return Promise.resolve(newTestResult); |
| 123 | }) |
| 124 | .catch(() => { }); |
| 125 | }; |
| 126 | |
| 127 | const _onCreateConnection = (test = false) => { |
| 128 | setErrors({}); |
no test coverage detected