summaryrefslogtreecommitdiff
path: root/internal/db/bundb/emoji_test.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-01-29 15:57:22 +0100
committerLibravatar GitHub <noreply@github.com>2024-01-29 14:57:22 +0000
commitaa8bbe6ad2e3908bd55bd6522524784cd4383ae2 (patch)
treebc1c3d742f2ef243936d4629aa0694affdbab5ca /internal/db/bundb/emoji_test.go
parent[chore] Add a couple tests for updating list entries (#2580) (diff)
downloadgotosocial-aa8bbe6ad2e3908bd55bd6522524784cd4383ae2.tar.xz
[bugfix] Fix Postgres emoji delete, emoji category change (#2570)
* [bugfix] Fix Postgres emoji delete, emoji category change * revert trace logging * caching issue * update tests
Diffstat (limited to 'internal/db/bundb/emoji_test.go')
-rw-r--r--internal/db/bundb/emoji_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/db/bundb/emoji_test.go b/internal/db/bundb/emoji_test.go
index f75334d90..a4bf18f6e 100644
--- a/internal/db/bundb/emoji_test.go
+++ b/internal/db/bundb/emoji_test.go
@@ -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))
}