From c4a08292ee44bc731ff90bad18a3f37e5ee8ef22 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 26 Sep 2022 11:56:01 +0200 Subject: [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) --- internal/api/client/account/accountupdate_test.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'internal/api/client/account/accountupdate_test.go') 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("

this is my new bio read it and weep

", apimodelAccount.Note) + suite.Equal("

this is my new bio read it and weep :rainbow:

", 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("

this is my new bio read it and weep :rainbow:

", dbZork.Note) + suite.True(*dbZork.Locked) + suite.NotEmpty(dbZork.EmojiIDs) } func (suite *AccountUpdateTestSuite) TestAccountUpdateCredentialsPATCHHandlerWithMedia() { -- cgit v1.2.3