[bugfix] Fix Postgres emoji delete, emoji category change (#2570)

* [bugfix] Fix Postgres emoji delete, emoji category change

* revert trace logging

* caching issue

* update tests
This commit is contained in:
tobi 2024-01-29 15:57:22 +01:00 committed by GitHub
commit aa8bbe6ad2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 500 additions and 233 deletions

View file

@ -23,6 +23,7 @@ import (
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/testrig"
)
@ -160,6 +161,16 @@ func (suite *EmojiTestSuite) TestGetEmojiCategory() {
suite.NotNil(category)
}
func (suite *EmojiTestSuite) TestUpdateEmojiCategory() {
testEmoji := new(gtsmodel.Emoji)
*testEmoji = *suite.testEmojis["rainbow"]
testEmoji.CategoryID = ""
err := suite.db.UpdateEmoji(context.Background(), testEmoji, "category_id")
suite.NoError(err)
}
func TestEmojiTestSuite(t *testing.T) {
suite.Run(t, new(EmojiTestSuite))
}