diff options
author | 2022-09-26 11:56:01 +0200 | |
---|---|---|
committer | 2022-09-26 11:56:01 +0200 | |
commit | c4a08292ee44bc731ff90bad18a3f37e5ee8ef22 (patch) | |
tree | 1726f8450ec37f744204a857c3be2bfab17f206c /internal/api/client/account/accountupdate_test.go | |
parent | [bugfix] more nil checks baybeeeeeeeeeeeeeeeeeeee (#854) (diff) | |
download | gotosocial-c4a08292ee44bc731ff90bad18a3f37e5ee8ef22.tar.xz |
[feature] Show + federate emojis in accounts (#837)
* Start adding account emoji
* get emojis serialized + deserialized nicely
* update tests
* set / retrieve emojis on accounts
* show account emojis in web view
* fetch emojis from db based on ids
* fix typo in test
* lint
* fix pg migration
* update tests
* update emoji checking logic
* update comment
* clarify comments + add some spacing
* tidy up loops a lil (thanks kim)
Diffstat (limited to 'internal/api/client/account/accountupdate_test.go')
-rw-r--r-- | internal/api/client/account/accountupdate_test.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/internal/api/client/account/accountupdate_test.go b/internal/api/client/account/accountupdate_test.go index d59cd02a5..259bb69e9 100644 --- a/internal/api/client/account/accountupdate_test.go +++ b/internal/api/client/account/accountupdate_test.go @@ -200,7 +200,7 @@ func (suite *AccountUpdateTestSuite) TestAccountUpdateCredentialsPATCHHandlerGet func (suite *AccountUpdateTestSuite) TestAccountUpdateCredentialsPATCHHandlerTwoFields() { // set up the request // we're updating the note of zork, and setting locked to true - newBio := "this is my new bio read it and weep" + newBio := "this is my new bio read it and weep :rainbow:" requestBody, w, err := testrig.CreateMultipartFormData( "", "", map[string]string{ @@ -235,9 +235,19 @@ func (suite *AccountUpdateTestSuite) TestAccountUpdateCredentialsPATCHHandlerTwo // check the returned api model account // fields should be updated - suite.Equal("<p>this is my new bio read it and weep</p>", apimodelAccount.Note) + suite.Equal("<p>this is my new bio read it and weep :rainbow:</p>", apimodelAccount.Note) suite.Equal(newBio, apimodelAccount.Source.Note) suite.True(apimodelAccount.Locked) + suite.NotEmpty(apimodelAccount.Emojis) + suite.Equal(apimodelAccount.Emojis[0].Shortcode, "rainbow") + + // check the account in the database + dbZork, err := suite.db.GetAccountByID(context.Background(), apimodelAccount.ID) + suite.NoError(err) + suite.Equal(newBio, dbZork.NoteRaw) + suite.Equal("<p>this is my new bio read it and weep :rainbow:</p>", dbZork.Note) + suite.True(*dbZork.Locked) + suite.NotEmpty(dbZork.EmojiIDs) } func (suite *AccountUpdateTestSuite) TestAccountUpdateCredentialsPATCHHandlerWithMedia() { |