diff --git a/platform/src/test/java/net/silthus/schat/platform/config/ConfigTests.java b/platform/src/test/java/net/silthus/schat/platform/config/ConfigTests.java
index 5cd802608..22c4fd4d1 100644
--- a/platform/src/test/java/net/silthus/schat/platform/config/ConfigTests.java
+++ b/platform/src/test/java/net/silthus/schat/platform/config/ConfigTests.java
@@ -28,7 +28,6 @@
import java.util.Optional;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
-import net.kyori.adventure.text.minimessage.MiniMessage;
import net.silthus.schat.channel.Channel;
import net.silthus.schat.chatter.ChatterMock;
import net.silthus.schat.commands.CreatePrivateChannelCommand;
@@ -42,8 +41,11 @@
import org.junit.jupiter.api.io.TempDir;
import static net.kyori.adventure.text.Component.text;
+import static net.kyori.adventure.text.format.NamedTextColor.AQUA;
import static net.kyori.adventure.text.format.NamedTextColor.GRAY;
+import static net.kyori.adventure.text.format.NamedTextColor.GREEN;
import static net.kyori.adventure.text.format.NamedTextColor.YELLOW;
+import static net.kyori.adventure.text.format.TextDecoration.UNDERLINED;
import static net.silthus.schat.channel.ChannelHelper.channelWith;
import static net.silthus.schat.channel.ChannelRepository.createInMemoryChannelRepository;
import static net.silthus.schat.channel.ChannelSettings.PROTECTED;
@@ -62,7 +64,6 @@
class ConfigTests {
- private static final MiniMessage FORMATTER = MiniMessage.miniMessage();
private SChatConfig config;
@BeforeEach
@@ -118,7 +119,7 @@ void set_values_writes_and_loads_when_reloaded() {
void loads_custom_private_chat_message_format() {
final Component format = config.get(VIEW_CONFIG).format().get(MESSAGE_FORMAT)
.format(View.empty(), message("Hey").source(identity("Bob")).create());
- assertThat(FORMATTER.serialize(format)).isEqualTo("[Bob]: Hey");
+ assertThat(format).isEqualTo(text().append(text("[Bob]", AQUA)).append(text(": Hey")).build());
}
@Test
@@ -132,7 +133,7 @@ void uses_default_format_if_no_config_is_set() {
final Tab tab = mock(Tab.class);
when(tab.get(Tab.CHANNEL)).thenReturn(Optional.of(channel));
final Component format = config.get(VIEW_CONFIG).privateChatFormat().get(ACTIVE_TAB_FORMAT).format(view, tab);
- assertThat(FORMATTER.serialize(format)).isEqualTo("Karl");
+ assertThat(format).isEqualTo(text("Karl", GREEN, UNDERLINED));
}
}
}
diff --git a/ui/src/test/java/net/silthus/schat/ui/format/MiniMessageFormatTest.java b/ui/src/test/java/net/silthus/schat/ui/format/MiniMessageFormatTest.java
index b7acd3355..fc1ed48a0 100644
--- a/ui/src/test/java/net/silthus/schat/ui/format/MiniMessageFormatTest.java
+++ b/ui/src/test/java/net/silthus/schat/ui/format/MiniMessageFormatTest.java
@@ -61,7 +61,7 @@ void simple_text_only_message() {
void formatted_text_message() {
assertFormat("",
message(text("Hi").append(text(" there!", RED, BOLD))),
- "Hi there!"
+ "Hi there!"
);
}
@@ -69,7 +69,7 @@ void formatted_text_message() {
void message_without_source_but_source_format() {
assertFormat("