added apiemoji tests

This commit is contained in:
neon443 committed 2025-10-31 15:06:53 +00:00
1 parent 8df79c7072
commit a55c4b8c31
12 files changed
+26 -1

No files matched your search

+23
View File
@@ -8,6 +8,29 @@
import Testing
import Foundation
struct ApiEmojiTests {
@Test func ApiEmojiEncode() async throws {
let apiEmoji = ApiEmoji(name: "name", url: "https://")
let encoded = try! JSONEncoder().encode(apiEmoji)
let decoded = try! JSONDecoder().decode(ApiEmoji.self, from: encoded)
#expect(decoded == apiEmoji)
}
@Test func ApiEmojiEncoder() async throws {
let json = "{\"name\":\"name\",\"urlString\":\"https:\\/\\/\"}"
let decoded = try! JSONDecoder().decode(ApiEmoji.self, from: json.data(using: .utf8)!)
let expected = ApiEmoji(name: "name", url: "https://")
#expect(expected == ApiEmoji(name: "name", url: "https://"))
}
@Test func ApiEmojiToEmoji() async throws {
let apiEmoji = ApiEmoji(name: "name", url: "https://")
let emoji = apiEmoji.toEmoji()
let expected = Emoji(apiEmoji: apiEmoji, id: emoji.id)
#expect(emoji == expected)
}
}
struct StickerSlackTests {
var hoarder = EmojiHoarder()
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.