use of com.aire.ux.test.ViewTest in project aire-components by aire-ux.
the class ApplicationLayoutTest method ensureActionManagerCanEnableAndDisableButtons.
@ViewTest
@DirtiesContext
void ensureActionManagerCanEnableAndDisableButtons(@Autowired UserInterface ui, @Context TestContext $) {
val action = spy(Actions.create("ui.module.stop", (self) -> {
}));
ui.register(Selection.path(":main:navigation"), Extensions.create(":management-menu", (NavigationBar p) -> {
val button = new Button("hello");
action.addActionEventListener(Type.ActionEnabled, (eventType, event) -> {
button.setEnabled(true);
});
action.addActionEventListener(Type.ActionDisabled, (eventType, event) -> {
button.setEnabled(true);
});
p.add(button);
}));
action.enable();
$.flush();
assertTrue($.selectFirst("vaadin-button[enabled]", Button.class).isPresent());
action.dispose();
}
use of com.aire.ux.test.ViewTest in project aire-components by aire-ux.
the class PluginTabViewTest method ensurePluginTabViewIsInjectable.
@ViewTest
@Navigate("zephyr/management/modules/list")
void ensurePluginTabViewIsInjectable(@Context TestContext $) {
val view = $.selectFirst("aire-tab-panel", TabPanel.class);
assertTrue(view.isPresent());
}
use of com.aire.ux.test.ViewTest in project aire-components by aire-ux.
the class CanvasTest method ensureInvocationAPIResultsInActionAvailableWhenAppliedThroughAction.
@ViewTest
void ensureInvocationAPIResultsInActionAvailableWhenAppliedThroughAction(@View Canvas canvas, @Context(mode = Mode.Spy) UI ui) {
val result = VertexTemplate.newBuilder("test").width(100f).height(100f).create();
val action = new AddVertexTemplateAction(() -> ui, result);
action.apply(canvas.getModel());
}
use of com.aire.ux.test.ViewTest in project aire-components by aire-ux.
the class CanvasTest method ensureAddVerticesActionisInvokable.
@ViewTest
@DirtiesContext
void ensureAddVerticesActionisInvokable(@View Canvas canvas) {
assertTrue(canvas.getModel().getVertices().isEmpty());
val vertices = List.of(new Vertex());
canvas.invoke(AddVerticesAction.class, vertices);
assertEquals(1, canvas.getModel().getVertices().size());
}
use of com.aire.ux.test.ViewTest in project aire-components by aire-ux.
the class ModuleGridTest method ensureModuleGridHasCorrectLayout.
@ViewTest
void ensureModuleGridHasCorrectLayout(@Context TestContext context, @Context Instantiator instantiator) {
val grid = instantiator.createComponent(ModuleGrid.class);
val $ = context.downTo(grid);
val columns = $.select(Grid.Column.class);
assertEquals(columns.size(), 5);
}
Aggregations