feat: add tests for controller #1829
reviewdog [golangci] report
reported by reviewdog 🐶
Findings (6)
controller/response_test.go|689 col 24| not enough arguments in call to NewQuestionnaire
controller/response_test.go|690 col 19| not enough arguments in call to NewResponse
controller/response_test.go|701 col 50| undefined: ctx (typecheck)
controller/response_test.go|717 col 54| undefined: ctx (typecheck)
controller/response_test.go|743 col 25| undefined: ctx (typecheck)
controller/response_test.go|704 col 2| declared and not used: questionnaireID (typecheck)
Filtered Findings (0)
Annotations
Check failure on line 689 in controller/response_test.go
github-actions / golangci
[golangci] controller/response_test.go#L689
not enough arguments in call to NewQuestionnaire
Raw output
controller/response_test.go:689:24: not enough arguments in call to NewQuestionnaire
have ()
want ("github.com/traPtitech/anke-to/model".IQuestionnaire, "github.com/traPtitech/anke-to/model".ITarget, "github.com/traPtitech/anke-to/model".ITargetGroup, "github.com/traPtitech/anke-to/model".ITargetUser, "github.com/traPtitech/anke-to/model".IAdministrator, "github.com/traPtitech/anke-to/model".IAdministratorGroup, "github.com/traPtitech/anke-to/model".IAdministratorUser, "github.com/traPtitech/anke-to/model".IQuestion, "github.com/traPtitech/anke-to/model".IOption, "github.com/traPtitech/anke-to/model".IScaleLabel, "github.com/traPtitech/anke-to/model".IValidation, "github.com/traPtitech/anke-to/model".ITransaction, "github.com/traPtitech/anke-to/model".IRespondent, "github.com/traPtitech/anke-to/traq".IWebhook, *Response) (typecheck)
q := NewQuestionnaire()
^
Check failure on line 690 in controller/response_test.go
github-actions / golangci
[golangci] controller/response_test.go#L690
not enough arguments in call to NewResponse
Raw output
controller/response_test.go:690:19: not enough arguments in call to NewResponse
have ()
want ("github.com/traPtitech/anke-to/model".IQuestionnaire, "github.com/traPtitech/anke-to/model".IRespondent, "github.com/traPtitech/anke-to/model".IResponse, "github.com/traPtitech/anke-to/model".ITarget, "github.com/traPtitech/anke-to/model".IQuestion, "github.com/traPtitech/anke-to/model".IValidation, "github.com/traPtitech/anke-to/model".IScaleLabel) (typecheck)
r := NewResponse()
^
Check failure on line 701 in controller/response_test.go
github-actions / golangci
[golangci] controller/response_test.go#L701
undefined: ctx (typecheck)
Raw output
controller/response_test.go:701:50: undefined: ctx (typecheck)
questionnairePosted, err := q.PostQuestionnaire(ctx, questionnaire.userID, questionnaire.params)
^
Check failure on line 717 in controller/response_test.go
github-actions / golangci
[golangci] controller/response_test.go#L717
undefined: ctx (typecheck)
Raw output
controller/response_test.go:717:54: undefined: ctx (typecheck)
responsePosted, err := q.PostQuestionnaireResponse(ctx, response.questionnaireID, response.params, response.userID)
^
Check failure on line 743 in controller/response_test.go
github-actions / golangci
[golangci] controller/response_test.go#L743
undefined: ctx (typecheck)
Raw output
controller/response_test.go:743:25: undefined: ctx (typecheck)
err := r.EditResponse(ctx, testCase.args.responseID, testCase.args.req)
^
Check failure on line 704 in controller/response_test.go
github-actions / golangci
[golangci] controller/response_test.go#L704
declared and not used: questionnaireID (typecheck)
Raw output
controller/response_test.go:704:2: declared and not used: questionnaireID (typecheck)
questionnaireID := questionnairePosted.QuestionnaireId
^