aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-12-20 10:56:15 -0800
committerZeyla Hellyer <[email protected]>2017-12-20 11:06:24 -0800
commitf2fa349d831c1db59993341284049ffbd56dde3b (patch)
treeab31444f6e44d0102f938ef646ccee6da38ff411 /tests
parentAdd variant adapters to Channel (#238) (diff)
downloadserenity-f2fa349d831c1db59993341284049ffbd56dde3b.tar.xz
serenity-f2fa349d831c1db59993341284049ffbd56dde3b.zip
Add `animated` to `Emoji` and `ReactionType`
Adds an animated structfield to `Emoji` and `ReactionType`'s `Custom` variant, which defaults to false if not present. A test has been added for deserializing it, taken from a REST API GET Emojis response. (cherry picked from commit 5286949f424e824784344ebb7b7af4e52fb819c3)
Diffstat (limited to 'tests')
-rw-r--r--tests/resources/emoji_animated.json14
-rw-r--r--tests/test_deser.rs5
-rw-r--r--tests/test_formatters.rs1
-rw-r--r--tests/test_msg_builder.rs1
4 files changed, 21 insertions, 0 deletions
diff --git a/tests/resources/emoji_animated.json b/tests/resources/emoji_animated.json
new file mode 100644
index 0000000..18173bb
--- /dev/null
+++ b/tests/resources/emoji_animated.json
@@ -0,0 +1,14 @@
+{
+ "managed": false,
+ "name": "abc",
+ "roles": [],
+ "user": {
+ "username": "zeyla",
+ "discriminator": "5479",
+ "id": "114941315417899012",
+ "avatar": "d8c3dacd468ef9e48ca28add856fbfe2"
+ },
+ "require_colons": true,
+ "animated": false,
+ "id": "300000000000000000"
+}
diff --git a/tests/test_deser.rs b/tests/test_deser.rs
index ae9536b..e547e9d 100644
--- a/tests/test_deser.rs
+++ b/tests/test_deser.rs
@@ -35,6 +35,11 @@ fn channel_update() {
p!(ChannelUpdateEvent, "channel_update_1");
}
+#[test]
+fn emoji_animated() {
+ p!(Emoji, "emoji_animated");
+}
+
// A game with null type.
#[test]
fn game() {
diff --git a/tests/test_formatters.rs b/tests/test_formatters.rs
index e44c550..9fcc044 100644
--- a/tests/test_formatters.rs
+++ b/tests/test_formatters.rs
@@ -35,6 +35,7 @@ fn test_mention() {
nsfw: false,
})));
let emoji = Emoji {
+ animated: false,
id: EmojiId(5),
name: "a".to_string(),
managed: true,
diff --git a/tests/test_msg_builder.rs b/tests/test_msg_builder.rs
index bbb0dd7..c291bf5 100644
--- a/tests/test_msg_builder.rs
+++ b/tests/test_msg_builder.rs
@@ -33,6 +33,7 @@ fn no_free_formatting() {
fn mentions() {
let content_emoji = MessageBuilder::new()
.emoji(&Emoji {
+ animated: false,
id: EmojiId(32),
name: "Rohrkatze".to_string(),
managed: false,