Skip to content

Commit

Permalink
🐛Fix updating Bluesky Link
Browse files Browse the repository at this point in the history
  • Loading branch information
0x46616c6b committed May 5, 2024
1 parent 6fda916 commit b403c97
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
22 changes: 21 additions & 1 deletion internal/storage/sql_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,15 @@ func (s *SqlStorageTestSuite) TestSaveTicker() {

s.Run("when ticker is existing and properties are updated", func() {
ticker.Active = true
ticker.Information = TickerInformation{Author: "Author"}
ticker.Information = TickerInformation{
Author: "Author",
Email: "Email",
Twitter: "Twitter",
Facebook: "Facebook",
Telegram: "Telegram",
Mastodon: "Mastodon",
Bluesky: "Bluesky",
}
ticker.Location = TickerLocation{Lat: 1, Lon: 1}

s.NoError(s.store.SaveTicker(&ticker))
Expand All @@ -583,6 +591,12 @@ func (s *SqlStorageTestSuite) TestSaveTicker() {

ticker.Active = false
ticker.Information.Author = ""
ticker.Information.Email = ""
ticker.Information.Twitter = ""
ticker.Information.Facebook = ""
ticker.Information.Telegram = ""
ticker.Information.Mastodon = ""
ticker.Information.Bluesky = ""
ticker.Location.Lat = 0
ticker.Location.Lon = 0

Expand All @@ -591,6 +605,12 @@ func (s *SqlStorageTestSuite) TestSaveTicker() {
ticker, err := s.store.FindTickerByID(ticker.ID)
s.NoError(err)
s.Equal("", ticker.Information.Author)
s.Equal("", ticker.Information.Email)
s.Equal("", ticker.Information.Twitter)
s.Equal("", ticker.Information.Facebook)
s.Equal("", ticker.Information.Telegram)
s.Equal("", ticker.Information.Mastodon)
s.Equal("", ticker.Information.Bluesky)
s.Equal(float64(0), ticker.Location.Lat)
s.Equal(float64(0), ticker.Location.Lon)
})
Expand Down
1 change: 1 addition & 0 deletions internal/storage/ticker.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (t *Ticker) AsMap() map[string]interface{} {
"twitter": t.Information.Twitter,
"facebook": t.Information.Facebook,
"telegram": t.Information.Telegram,
"bluesky": t.Information.Bluesky,
"lat": t.Location.Lat,
"lon": t.Location.Lon,
}
Expand Down

0 comments on commit b403c97

Please sign in to comment.