diff --git a/Resources/RectIcon.pxd b/Resources/RectIcon.pxd new file mode 100644 index 0000000..a74c2a2 Binary files /dev/null and b/Resources/RectIcon.pxd differ diff --git a/StickerSlack/Views/ContentView.swift b/StickerSlack/Views/ContentView.swift index 763e750..7b4cb97 100644 --- a/StickerSlack/Views/ContentView.swift +++ b/StickerSlack/Views/ContentView.swift @@ -46,13 +46,15 @@ struct ContentView: View { Button("", systemImage: "checkmark") { if let sticker = emoji.sticker { if sticker.validate() { + print("validation of \(emoji.name) succeeded") Haptic.success.trigger() } else { + print("validation of \(emoji.name) failed") Haptic.error.trigger() } } } - Spacer() + .buttonStyle(.plain) if emoji.isLocal { Button("", systemImage: "trash") { emoji.deleteImage() diff --git a/StickerSlackTests/StickerSlackTests.swift b/StickerSlackTests/StickerSlackTests.swift index 027cca8..eb8d3be 100644 --- a/StickerSlackTests/StickerSlackTests.swift +++ b/StickerSlackTests/StickerSlackTests.swift @@ -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() diff --git a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon.png b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon.png index 09f1d03..a6d12d6 100644 Binary files a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon.png and b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon.png differ diff --git a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon120.png b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon120.png index 9c5dc63..8362955 100644 Binary files a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon120.png and b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon120.png differ diff --git a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon134.png b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon134.png index a3c2b8d..b08ef53 100644 Binary files a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon134.png and b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon134.png differ diff --git a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon148.png b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon148.png index 46ba240..d899882 100644 Binary files a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon148.png and b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon148.png differ diff --git a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon180.png b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon180.png index f498759..971a9df 100644 Binary files a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon180.png and b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon180.png differ diff --git a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon54.png b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon54.png index fbb2c62..36715f8 100644 Binary files a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon54.png and b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon54.png differ diff --git a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon64.png b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon64.png index 8ae1c01..aa0c3fa 100644 Binary files a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon64.png and b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon64.png differ diff --git a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon81.png b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon81.png index be9b437..bad3602 100644 Binary files a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon81.png and b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon81.png differ diff --git a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon96.png b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon96.png index f4190da..aa6a183 100644 Binary files a/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon96.png and b/StickerSlackiMessageExtension/Assets.xcassets/iMessage App Icon.stickersiconset/rectIcon96.png differ