Closed rmsj closed 5 months ago
If a new test is added to the transaction api:
func create400(sd apitest.SeedData) []apitest.Table { table := []apitest.Table{ { Name: "basic", URL: "/v1/tranexample", Token: sd.Admins[0].Token, Method: http.MethodPost, StatusCode: http.StatusBadRequest, Input: &tranapp.NewTran{ Product: tranapp.NewProduct{ Quantity: 10, }, User: tranapp.NewUser{ Name: "Bill Kennedy", Email: "bill@ardanlabs.com", Roles: []string{"ADMIN"}, Department: "IT", Password: "123", PasswordConfirm: "123", }, }, GotResp: &tranapp.Product{}, ExpResp: nil, //TODO, CmpFunc: func(got any, exp any) string { return nil // TODO }, }, } return table }
The error that transaction.go sends is a 500 error, overriding the 400 from the validation. See transaction.go, line 40
PS.: Sorry, can't get format to behave.
I can reproduce this. Transactions have created all sort of chaos. I am looking into this now. THANKS
Ok, I just pushed a fix. This was a great catch.
If a new test is added to the transaction api:
func create400(sd apitest.SeedData) []apitest.Table { table := []apitest.Table{ { Name: "basic", URL: "/v1/tranexample", Token: sd.Admins[0].Token, Method: http.MethodPost, StatusCode: http.StatusBadRequest, Input: &tranapp.NewTran{ Product: tranapp.NewProduct{ Quantity: 10, }, User: tranapp.NewUser{ Name: "Bill Kennedy", Email: "bill@ardanlabs.com", Roles: []string{"ADMIN"}, Department: "IT", Password: "123", PasswordConfirm: "123", }, }, GotResp: &tranapp.Product{}, ExpResp: nil, //TODO, CmpFunc: func(got any, exp any) string { return nil // TODO }, }, } return table }
The error that transaction.go sends is a 500 error, overriding the 400 from the validation. See transaction.go, line 40
PS.: Sorry, can't get format to behave.