From b46f31e9f4786543e61b73d078e6026fefb48963 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 12 Mar 2022 14:19:34 -0600 Subject: [PATCH] Account normalizer emojification tests --- .../__fixtures__/account-with-emojis.json | 140 ++++++++++++++++++ .../normalizers/__tests__/account-test.js | Bin 3028 -> 6319 bytes 2 files changed, 140 insertions(+) create mode 100644 app/soapbox/__fixtures__/account-with-emojis.json diff --git a/app/soapbox/__fixtures__/account-with-emojis.json b/app/soapbox/__fixtures__/account-with-emojis.json new file mode 100644 index 0000000000..19025e150b --- /dev/null +++ b/app/soapbox/__fixtures__/account-with-emojis.json @@ -0,0 +1,140 @@ +{ + "acct": "alex", + "avatar": "https://media.gleasonator.com/6d64aecb17348b23aaff78db4687b9476cb0da1c07cc6a819c2e6ec7144c18b1.png", + "avatar_static": "https://media.gleasonator.com/6d64aecb17348b23aaff78db4687b9476cb0da1c07cc6a819c2e6ec7144c18b1.png", + "bot": false, + "created_at": "2020-01-08T01:25:43.000Z", + "display_name": "Alex Gleason 😂 :soapbox: :ablobcatrainbow:", + "emojis": [ + { + "shortcode": "ablobcatrainbow", + "static_url": "https://gleasonator.com/emoji/blobcat/ablobcatrainbow.png", + "url": "https://gleasonator.com/emoji/blobcat/ablobcatrainbow.png", + "visible_in_picker": false + }, + { + "shortcode": "soapbox", + "static_url": "https://gleasonator.com/emoji/Gleasonator/soapbox.png", + "url": "https://gleasonator.com/emoji/Gleasonator/soapbox.png", + "visible_in_picker": false + } + ], + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Soapbox :ablobcatrainbow:", + "value": "https://soapbox.pub :soapbox:" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + }, + { + "name": "Donate (PayPal)", + "value": "https://paypal.me/gleasonator" + }, + { + "name": "$BTC", + "value": "bc1q9cx35adpm73aq2fw40ye6ts8hfxqzjr5unwg0n" + }, + { + "name": "$ETH", + "value": "0xAc9aB5Fc04Dc1cB1789Af75b523Bd23C70B2D717" + }, + { + "name": "$DOGE", + "value": "D5zVZs6jrRakaPVGiErkQiHt9sayzm6V5D" + }, + { + "name": "$XMR", + "value": "45JDCLrjJ4bgVUSbbs2yjy9m5Mf4VLPW8fG7jw9sq5u69rXZZopQogZNeyYkMBnXpkaip4p4QwaaJNhdTotPa9g44DBCzdK" + } + ], + "followers_count": 2476, + "following_count": 1584, + "fqn": "alex@gleasonator.com", + "header": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "header_static": "https://media.gleasonator.com/accounts/headers/000/000/001/original/9d0e4dbf1c9dbc8f.png", + "id": "9v5bmRalQvjOy0ECcC", + "last_status_at": "2022-03-12T16:35:10", + "locked": false, + "note": "I create Fediverse software that empowers people online. :soapbox:

I'm vegan btw

Note: If you have a question for me, please tag me publicly. This gives the opportunity for others to chime in, and bystanders to learn.", + "pleroma": { + "accepts_chat_messages": true, + "also_known_as": [ + "https://mitra.social/users/alex" + ], + "ap_id": "https://gleasonator.com/users/alex", + "background_image": null, + "birthday": "1993-07-03", + "favicon": "https://gleasonator.com/favicon.png", + "hide_favorites": true, + "hide_followers": false, + "hide_followers_count": false, + "hide_follows": false, + "hide_follows_count": false, + "is_admin": true, + "is_confirmed": true, + "is_moderator": false, + "is_suggested": true, + "relationship": {}, + "skip_thread_containment": false, + "tags": [] + }, + "source": { + "fields": [ + { + "name": "Website", + "value": "https://alexgleason.me" + }, + { + "name": "Soapbox :ablobcatrainbow:", + "value": "https://soapbox.pub :soapbox:" + }, + { + "name": "Email", + "value": "alex@alexgleason.me" + }, + { + "name": "Gender identity", + "value": "Soyboy" + }, + { + "name": "Donate (PayPal)", + "value": "https://paypal.me/gleasonator" + }, + { + "name": "$BTC", + "value": "bc1q9cx35adpm73aq2fw40ye6ts8hfxqzjr5unwg0n" + }, + { + "name": "$ETH", + "value": "0xAc9aB5Fc04Dc1cB1789Af75b523Bd23C70B2D717" + }, + { + "name": "$DOGE", + "value": "D5zVZs6jrRakaPVGiErkQiHt9sayzm6V5D" + }, + { + "name": "$XMR", + "value": "45JDCLrjJ4bgVUSbbs2yjy9m5Mf4VLPW8fG7jw9sq5u69rXZZopQogZNeyYkMBnXpkaip4p4QwaaJNhdTotPa9g44DBCzdK" + } + ], + "note": "I create Fediverse software that empowers people online. :soapbox:\r\n\r\nI'm vegan btw\r\n\r\nNote: If you have a question for me, please tag me publicly. This gives the opportunity for others to chime in, and bystanders to learn.", + "pleroma": { + "actor_type": "Person", + "discoverable": false + }, + "sensitive": false + }, + "statuses_count": 23674, + "url": "https://gleasonator.com/users/alex", + "username": "alex" +} diff --git a/app/soapbox/normalizers/__tests__/account-test.js b/app/soapbox/normalizers/__tests__/account-test.js index cf64fe18e9895d5be7f7ed6d1a564d603e5095be..81e7d9b7f72da5c45ef303b9e77f90514248417a 100644 GIT binary patch literal 6319 zcmds5-EP}96u$3M9B9Dg0I`%b*owGu&=kws3~Ny!*;O;Rv_wlxB~l?NJ5JD>J;m-_Wch1N2$I?tl4L2~7BK_qQz7#*eWoepgGEAuZ^4T+1 z32`A)lCW!f6a*sYx)%35pOlY`d`MLw*^qYJ#RZ)$cN;oe&_9HmX8=q$L=+H6Dc4N! zIU#^RaHWBai6-(LQ;P8j`XK3L&LkefQW8<+m+!l2Dd1&1a<@-5i&eU^_+y z^Fh^h58U_1$7k0ni0La9hL@qIM8HVmZd)l9qRjsIhvDQ!eEjD1hhU$}>^i95=Q2To zSnEvne80JcpDQYrU++I#g3mcgY4dRV^2@yLlBzt>sQQvcEh-c@Q0P@g1KlabJ(`LO zrnWpSjxTePbS&;dE`k97o$YcokN5>(Vw)4tzxu!);EG0-b6j%OWFk)9aN23k~ z{>X0HwS@OB6cV;FXvwtOy=51n(k+&()SQ{b-QC~c>+Zbh?(CJuZwLAzp?H1CT5)FO zo|_0Wp%DqDfJ{h2wGN+FSf6|N{R)U9s!w?5qifGWm0hL=B+zV3UA&AXowdwMHZNY| z_T@;m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