use of com.googlecode.wicket.jquery.ui.widget.menu.Menu in project openmeetings by apache.
the class TestCalendar method testEventCreate.
@Test
public void testEventCreate() throws OmException {
testArea(regularUsername, p -> {
Menu menu = (Menu) p.get(PATH_MENU);
Assert.assertNotNull(menu);
tester.getRequest().setParameter("hash", menu.getItemList().get(0).getItems().get(1).getId());
tester.executeBehavior((AbstractAjaxBehavior) menu.getBehaviorById(0));
tester.assertComponent(PATH_CHILD, CalendarPanel.class);
CalendarPanel cal = (CalendarPanel) p.get(PATH_CHILD);
tester.executeAllTimerBehaviors(cal);
User u = userDao.getByLogin(regularUsername, User.Type.user, null);
// test create month
tester.getRequest().setParameter("allDay", String.valueOf(false));
tester.getRequest().setParameter("startDate", LocalDateTime.of(2017, 11, 13, 13, 13).toString());
tester.getRequest().setParameter("endDate", LocalDateTime.of(2017, 11, 13, 13, 13).toString());
tester.getRequest().setParameter("viewName", CalendarView.month.name());
// select-event
tester.executeBehavior((AbstractAjaxBehavior) cal.get("form:calendar").getBehaviorById(0));
FormTester appTester = tester.newFormTester(PATH_APPOINTMENT_DLG_FRM);
// check inviteeType:groupContainer:groups is invisible for regular user
String title = String.format("title%s", UUID.randomUUID());
appTester.setValue("title", title);
ButtonAjaxBehavior save = getButtonBehavior(PATH_APPOINTMENT_DLG, "save");
tester.executeBehavior(save);
List<Appointment> appts = appointmentDao.searchByTitle(u.getId(), title);
assertEquals("Appointment should be created", 1, appts.size());
assertEquals("Appointment should be created", title, appts.get(0).getTitle());
});
}
use of com.googlecode.wicket.jquery.ui.widget.menu.Menu in project openmeetings by apache.
the class TestMainMenu method checkMenuItem.
private void checkMenuItem(int idx1, int idx2, Class<? extends BasePanel> clazz) throws OmException {
testArea(adminUsername, p -> {
Menu menu = (Menu) p.get(PATH_MENU);
Assert.assertNotNull(menu);
tester.getRequest().setParameter("hash", menu.getItemList().get(idx1).getItems().get(idx2).getId());
tester.executeBehavior((AbstractAjaxBehavior) menu.getBehaviorById(0));
tester.assertComponent(PATH_CHILD, clazz);
});
}
Aggregations