@@ -19,7 +19,6 @@ package emailpassword
19
19
import (
20
20
"bytes"
21
21
"encoding/json"
22
- "fmt"
23
22
"io"
24
23
"net/http"
25
24
"net/http/httptest"
@@ -104,7 +103,7 @@ func TestInvalidAPIInputForFormFields(t *testing.T) {
104
103
}{
105
104
{
106
105
input : map [string ]interface {}{},
107
- expected : "Missing input param" ,
106
+ expected : "Missing input param: formFields " ,
108
107
fieldError : false ,
109
108
},
110
109
{
@@ -221,8 +220,6 @@ func TestInvalidAPIInputForFormFields(t *testing.T) {
221
220
resp , err := http .Post (testServer .URL + api , "application/json" , bytes .NewBuffer (objToJson (testCase .input )))
222
221
assert .NoError (t , err )
223
222
224
- fmt .Println (testCase , api , resp .StatusCode )
225
-
226
223
if testCase .fieldError {
227
224
assert .Equal (t , 200 , resp .StatusCode )
228
225
} else {
@@ -239,16 +236,16 @@ func TestInvalidAPIInputForFormFields(t *testing.T) {
239
236
t .Error (err .Error ())
240
237
}
241
238
242
- // if testCase.fieldError {
243
- // assert.Equal(t, "FIELD_ERROR", data["status"].(string))
239
+ if testCase .fieldError {
240
+ assert .Equal (t , "FIELD_ERROR" , data ["status" ].(string ))
244
241
245
- // for _, formField := range data["formFields"].([]interface{}) {
246
- // errorMessage := formField.(map[string]interface{})["error"]
247
- // assert.Equal(t, testCase.expected, errorMessage)
248
- // }
249
- // } else {
250
- // assert.Equal(t, testCase.expected, data["message"])
251
- // }
242
+ for _ , formField := range data ["formFields" ].([]interface {}) {
243
+ errorMessage := formField .(map [string ]interface {})["error" ]
244
+ assert .Equal (t , testCase .expected , errorMessage )
245
+ }
246
+ } else {
247
+ assert .Equal (t , testCase .expected , data ["message" ])
248
+ }
252
249
253
250
}
254
251
}
0 commit comments