use of com.aire.ux.UserInterface 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();
}
Aggregations