Skip to content

Commit

Permalink
Update game test
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Jan 12, 2022
1 parent 3be5621 commit 51b6692
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ dependencies {

modLocalRuntime "com.terraformersmc:modmenu:${modmenu_version}"

// Test dependencies
modCompileOnly "io.github.ladysnake:elmendorf:${elmendorf_version}"
modLocalRuntime "io.github.ladysnake:elmendorf:${elmendorf_version}"
testmodImplementation sourceSets.main.output
}

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ org.gradle.jvmargs=-Xmx1G
cca_version = 3.1.1
fpa_version = 0.1-SNAPSHOT
modmenu_version = 3.0.0
elmendorf_version = 0.3.0

# Publishing
owners = Ladysnake
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,21 @@
*/
package io.github.ladysnake.babblings.tests;

import io.github.ladysnake.blabber.Blabber;
import io.github.ladysnake.blabber.impl.common.DialogueScreenHandler;
import io.github.ladysnake.elmendorf.GameTestUtil;
import net.fabricmc.fabric.api.gametest.v1.FabricGameTest;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.test.GameTest;
import net.minecraft.test.TestContext;
import net.minecraft.util.Identifier;

public final class BlabberTestSuite implements FabricGameTest {
@GameTest(structureName = EMPTY_STRUCTURE)
public void complete(TestContext ctx) {
ServerPlayerEntity player = GameTestUtil.spawnPlayer(ctx, 2, 2, 2);
Blabber.startDialogue(player, new Identifier("babblings:remnant_choice"));
GameTestUtil.assertTrue("startDialogue did not work", player.currentScreenHandler instanceof DialogueScreenHandler handler && handler.isUnskippable() && handler.getCurrentChoices().size() == 3);
ctx.complete();
}
}

0 comments on commit 51b6692

Please sign in to comment.