From 231857e9257b4d7c541c6741b5b27e9ca0db3190 Mon Sep 17 00:00:00 2001 From: Solareon <769465+solareon@users.noreply.github.com> Date: Fri, 27 Feb 2026 08:40:46 +0100 Subject: [PATCH] refactor: remove excessive test --- .../Specs/ComponentParsingSpecs.cs | 83 ------------------- 1 file changed, 83 deletions(-) delete mode 100644 DiscordChatExporter.Cli.Tests/Specs/ComponentParsingSpecs.cs diff --git a/DiscordChatExporter.Cli.Tests/Specs/ComponentParsingSpecs.cs b/DiscordChatExporter.Cli.Tests/Specs/ComponentParsingSpecs.cs deleted file mode 100644 index f723a21c..00000000 --- a/DiscordChatExporter.Cli.Tests/Specs/ComponentParsingSpecs.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System.Text.Json; -using DiscordChatExporter.Core.Discord.Data; -using FluentAssertions; -using Xunit; - -namespace DiscordChatExporter.Cli.Tests.Specs; - -public class ComponentParsingSpecs -{ - [Fact] - public void I_can_parse_a_link_button_component_from_a_message_payload() - { - // Arrange - using var document = JsonDocument.Parse( - """ - { - "id": "123456789012345678", - "type": 0, - "author": { - "id": "987654321098765432", - "username": "Tester", - "discriminator": "0", - "avatar": null - }, - "timestamp": "2026-02-25T00:00:00.000000+00:00", - "content": "", - "attachments": [], - "components": [ - { - "type": 1, - "components": [ - { - "type": 2, - "style": 5, - "label": "Direct Link", - "url": "https://www.example.com", - "custom_id": null, - "sku_id": null, - "disabled": false, - "emoji": { - "id": null, - "name": "📎", - "animated": false - } - } - ] - } - ], - "embeds": [], - "sticker_items": [], - "reactions": [], - "mentions": [] - } - """ - ); - - // Act - var message = Message.Parse(document.RootElement); - - // Assert - message.Components.Should().HaveCount(1); - message.IsEmpty.Should().BeFalse(); - - var actionRow = message.Components[0]; - actionRow.Components.Should().HaveCount(1); - - var button = actionRow.Components[0]; - button.Style.Should().Be(DiscordChatExporter.Core.Discord.Data.Components.ButtonStyle.Link); - button.Label.Should().Be("Direct Link"); - button - .Url.Should() - .Be( - "https://www.example.com" - ); - button.IsUrlButton.Should().BeTrue(); - button.IsDisabled.Should().BeFalse(); - - button.Emoji.Should().NotBeNull(); - button.Emoji!.Id.Should().BeNull(); - button.Emoji.Name.Should().Be("📎"); - button.Emoji.Code.Should().Be("paperclip"); - } -}