Fix merge conflicts. Added tests.

This commit is contained in:
Alexander Zhuravlev 2024-05-08 19:46:32 +03:00
parent 303ef9efe9
commit ef76f4831c
2 changed files with 29 additions and 1 deletions

View File

@ -43,7 +43,7 @@ type (
Type *PartyType `json:"type,omitempty"` // party type for the suggestion (user input)
Query string `json:"query"` // user input for suggestion
Count int `json:"count"` // ligmit for results
Language *string `json:"language,omitempty"`
Language string `json:"language,omitempty"`
Locations []*RequestParamsLocation `json:"locations"`
RestrictValue bool `json:"restrict_value"` // don't show restricts (region) on results

View File

@ -53,6 +53,34 @@ func (s *ApiSuggestIntegrationTest) TestAddress() {
s.NotEmpty(res)
}
func (s *ApiSuggestIntegrationTest) TestAddressWithLanguageParamRU() {
api := NewSuggestApi()
params := suggest.RequestParams{
Query: "ул Свободы",
Language: "RU",
}
res, err := api.Address(context.Background(), &params)
s.NoError(err)
s.NotEmpty(res)
}
func (s *ApiSuggestIntegrationTest) TestAddressWithLanguageParamEN() {
api := NewSuggestApi()
params := suggest.RequestParams{
Query: "ул Свободы",
Language: "EN",
}
res, err := api.Address(context.Background(), &params)
s.NoError(err)
s.NotEmpty(res)
}
func (s *ApiSuggestIntegrationTest) TestBank() {
api := NewSuggestApi()
params := suggest.RequestParams{