Skip to content

Commit

Permalink
Add initialization to CommandBox UI unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sp4ce-cowboy committed Oct 28, 2023
1 parent 7032ddd commit d89c7aa
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/java/unicash/ui/CommandBoxUiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,36 @@

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.testfx.api.FxRobot;
import org.testfx.api.FxToolkit;
import org.testfx.framework.junit5.ApplicationExtension;
import org.testfx.framework.junit5.Start;

import javafx.scene.Scene;
import javafx.scene.input.KeyCode;
import javafx.stage.Stage;
import org.testfx.util.WaitForAsyncUtils;
import unicash.MainApp;

import java.util.concurrent.TimeoutException;


@ExtendWith(ApplicationExtension.class)
public class CommandBoxUiTest {

private CommandBox commandBox;

@BeforeEach
public void runAppToTests() throws TimeoutException {
FxToolkit.registerPrimaryStage();
FxToolkit.setupApplication(() -> new MainApp());
FxToolkit.showStage();
WaitForAsyncUtils.waitForFxEvents(100);
}

@Start
public void start(Stage stage) {
CommandBox.CommandExecutor dummyExecutor = (commandText) -> {
Expand Down

0 comments on commit d89c7aa

Please sign in to comment.