Skip to content

Commit 4282e7d

Browse files
committed
fix(test): grant admin permissions to HTML response test case
1 parent 61ca220 commit 4282e7d

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

pkg/app/ask_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,25 +120,25 @@ func TestGetBibleAsk(t *testing.T) {
120120
})
121121

122122
t.Run("HTML Response Handling", func(t *testing.T) {
123+
defer SetEnv("TELEGRAM_ADMIN_ID", "12345")()
123124
ResetAPIConfigCache()
124125
SetAPIConfigOverride("https://mock", "key")
125126

126127
// Mock SubmitQuery to return HTML
127128
SubmitQuery = func(req QueryRequest, result interface{}) error {
128-
if r, ok := result.(*PromptResponse); ok {
129-
*r = PromptResponse{
130-
Data: OQueryResponse{
131-
Text: "<p>God is <b>Love</b></p>",
132-
References: []SearchResult{
133-
{Verse: "1 John 4:8"},
134-
},
129+
if r, ok := result.(*OQueryResponse); ok {
130+
*r = OQueryResponse{
131+
Text: "<p>God is <b>Love</b></p>",
132+
References: []SearchResult{
133+
{Verse: "1 John 4:8"},
135134
},
136135
}
137136
}
138137
return nil
139138
}
140139

141140
var env def.SessionData
141+
env.User.Id = "12345"
142142
env.Msg.Message = "Who is God?"
143143
conf := utils.UserConfig{Version: "NIV"}
144144
env = utils.SetUserConfig(env, utils.SerializeUserConfig(conf))

0 commit comments

Comments
 (0)