Fix tests

This commit is contained in:
Nassim Jahnke 2022-06-08 17:31:27 +02:00
parent 7a165c9c5d
commit 02804a49a2
No known key found for this signature in database
GPG key ID: 6BE3B555EBC5982B
7 changed files with 44 additions and 42 deletions

View file

@ -129,7 +129,7 @@ index c47cae84f3b6970247d78382f48ae8ddbc202b59..0a46eeefa7d704350321828166f0049d
}
diff --git a/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java b/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..520801e294a33ae62d9aa24dc0247591e379311d
index 0000000000000000000000000000000000000000..4d043e0e43ef8bb75788e195f95b5a50a51a2a48
--- /dev/null
+++ b/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java
@@ -0,0 +1,24 @@
@ -138,7 +138,7 @@ index 0000000000000000000000000000000000000000..520801e294a33ae62d9aa24dc0247591
+import io.papermc.paper.adventure.PaperAdventure;
+import net.kyori.adventure.text.format.TextColor;
+import net.minecraft.advancements.FrameType;
+import net.minecraft.network.chat.TranslatableComponent;
+import net.minecraft.network.chat.contents.TranslatableContents;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
@ -149,7 +149,7 @@ index 0000000000000000000000000000000000000000..520801e294a33ae62d9aa24dc0247591
+ public void test() {
+ for (FrameType nmsFrameType : FrameType.values()) {
+ final TextColor expectedColor = PaperAdventure.asAdventure(nmsFrameType.getChatColor());
+ final String expectedTranslationKey = ((TranslatableComponent) nmsFrameType.getDisplayName()).getKey();
+ final String expectedTranslationKey = ((TranslatableContents) nmsFrameType.getDisplayName().getContents()).getKey();
+ final var frame = PaperAdvancementDisplay.asPaperFrame(nmsFrameType);
+ assertEquals("The translation keys should be the same", expectedTranslationKey, frame.translationKey());
+ assertEquals("The frame colors should be the same", expectedColor, frame.color());