Search in sources :

Example 21 with TimePicker

use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.

the class TimePickerTest method setMax_getMax_null.

@Test
public void setMax_getMax_null() {
    TimePicker timePicker = new TimePicker();
    assertEquals(null, timePicker.getMax());
    timePicker.setMax(null);
    assertEquals(null, timePicker.getMax());
    assertEquals(null, timePicker.getMaxTime());
}
Also used : TimePicker(com.vaadin.flow.component.timepicker.TimePicker) GeneratedVaadinTimePicker(com.vaadin.flow.component.timepicker.GeneratedVaadinTimePicker) Test(org.junit.Test)

Example 22 with TimePicker

use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.

the class TimePickerTest method timePickerWithPlaceholder.

@Test
public void timePickerWithPlaceholder() {
    String placeholder = new String("This is a Time Picker");
    TimePicker picker = new TimePicker();
    picker.setPlaceholder(placeholder);
    assertEquals(placeholder, picker.getElement().getProperty("placeholder"));
}
Also used : TimePicker(com.vaadin.flow.component.timepicker.TimePicker) GeneratedVaadinTimePicker(com.vaadin.flow.component.timepicker.GeneratedVaadinTimePicker) Test(org.junit.Test)

Example 23 with TimePicker

use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.

the class TimePickerTest method timePicker_nullValue.

@Test
public void timePicker_nullValue() {
    TimePicker timePicker = new TimePicker();
    timePicker.setValue(null);
    assertEquals(null, timePicker.getValue());
}
Also used : TimePicker(com.vaadin.flow.component.timepicker.TimePicker) GeneratedVaadinTimePicker(com.vaadin.flow.component.timepicker.GeneratedVaadinTimePicker) Test(org.junit.Test)

Example 24 with TimePicker

use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.

the class TimePickerTest method setMinTime_getMin.

@Test
public void setMinTime_getMin() {
    TimePicker timePicker = new TimePicker();
    final String min = "12:00";
    LocalTime minTime = LocalTime.parse(min);
    timePicker.setMinTime(minTime);
    assertEquals(minTime, timePicker.getMin());
    assertEquals(minTime, timePicker.getMinTime());
}
Also used : TimePicker(com.vaadin.flow.component.timepicker.TimePicker) GeneratedVaadinTimePicker(com.vaadin.flow.component.timepicker.GeneratedVaadinTimePicker) LocalTime(java.time.LocalTime) Test(org.junit.Test)

Example 25 with TimePicker

use of com.vaadin.flow.component.timepicker.TimePicker in project flow-components by vaadin.

the class TimePickerTest method testSetStep_hoursNotDivideEvenly_throwsException.

@Test(expected = IllegalArgumentException.class)
public void testSetStep_hoursNotDivideEvenly_throwsException() {
    TimePicker timePicker = new TimePicker();
    timePicker.setStep(Duration.ofHours(5));
}
Also used : TimePicker(com.vaadin.flow.component.timepicker.TimePicker) GeneratedVaadinTimePicker(com.vaadin.flow.component.timepicker.GeneratedVaadinTimePicker) Test(org.junit.Test)

Aggregations

TimePicker (com.vaadin.flow.component.timepicker.TimePicker)35 Test (org.junit.Test)23 GeneratedVaadinTimePicker (com.vaadin.flow.component.timepicker.GeneratedVaadinTimePicker)20 Div (com.vaadin.flow.component.html.Div)5 NativeButton (com.vaadin.flow.component.html.NativeButton)3 LocalTime (java.time.LocalTime)3 Checkbox (com.vaadin.flow.component.checkbox.Checkbox)2 DatePicker (com.vaadin.flow.component.datepicker.DatePicker)2 Span (com.vaadin.flow.component.html.Span)2 TextField (com.vaadin.flow.component.textfield.TextField)2 Duration (java.time.Duration)2 Locale (java.util.Locale)2 HasLabel (com.vaadin.flow.component.HasLabel)1 ComboBox (com.vaadin.flow.component.combobox.ComboBox)1 FormLayout (com.vaadin.flow.component.formlayout.FormLayout)1 HorizontalLayout (com.vaadin.flow.component.orderedlayout.HorizontalLayout)1 RichTextEditor (com.vaadin.flow.component.richtexteditor.RichTextEditor)1 Select (com.vaadin.flow.component.select.Select)1 IntegerField (com.vaadin.flow.component.textfield.IntegerField)1 Binder (com.vaadin.flow.data.binder.Binder)1