@@ -11,7 +11,7 @@ import (
1111 dotenv "github.com/joho/godotenv"
1212)
1313
14- func loadEnvs (t * testing.T ) (string , string ) {
14+ func loadEnvs (t * testing.T ) (string , string , string ) {
1515 err := dotenv .Load ()
1616 if err != nil {
1717 t .Fatal ("Error loading .env file" )
@@ -24,7 +24,8 @@ func loadEnvs(t *testing.T) (string, string) {
2424 if chatID == "" {
2525 t .Fatal ("Chat ID not specified in .env file" )
2626 }
27- return tg_token , chatID
27+ topicID := os .Getenv ("TOPIC_ID" )
28+ return tg_token , chatID , topicID
2829}
2930
3031func parse (t * testing.T , rawData []byte ) (string , string , string ) {
@@ -42,13 +43,13 @@ func parse(t *testing.T, rawData []byte) (string, string, string) {
4243}
4344
4445func TestCommitMessage (t * testing.T ) {
45- token , chatID := loadEnvs (t )
46+ token , chatID , topicID := loadEnvs (t )
4647 data , err := ioutil .ReadFile ("events/commit.json" )
4748 if err != nil {
4849 t .Fatal (err )
4950 }
5051 text , markupText , markupUrl := parse (t , data )
51- error := utils .SendMessage (token , chatID , text , markupText , markupUrl )
52+ error := utils .SendMessage (token , chatID , text , markupText , markupUrl , topicID )
5253 if error .Description != "" {
5354 t .Fatal (error .String ())
5455 }
0 commit comments