use of com.vaadin.flow.component.Key in project linkki by linkki-framework.
the class UIButtonIntegrationTest method testCreateButtonShortcut.
@Test
void testCreateButtonShortcut() {
ButtonComponentDefinitionCreator buttonComponentDefinitionCreator = new UIButton.ButtonComponentDefinitionCreator();
Optional<Key> shortcutKey = buttonComponentDefinitionCreator.createShortcutKey(getAnnotation("value"));
List<String> keys = shortcutKey.get().getKeys();
assertThat(keys.size(), is(1));
assertThat(keys.get(0), is("Enter"));
}
use of com.vaadin.flow.component.Key in project linkki by linkki-framework.
the class UIButtonIntegrationTest method testCreateButtonShortcut_MultipleKeys.
@Test
void testCreateButtonShortcut_MultipleKeys() {
ButtonComponentDefinitionCreator buttonComponentDefinitionCreator = new UIButton.ButtonComponentDefinitionCreator();
Optional<Key> shortcutKey = buttonComponentDefinitionCreator.createShortcutKey(getAnnotation("staticValue"));
List<String> keys = shortcutKey.get().getKeys();
assertThat(keys.size(), is(3));
assertThat(keys.get(0), is("KeyA"));
assertThat(keys.get(1), is("KeyB"));
assertThat(keys.get(2), is("KeyC"));
}
use of com.vaadin.flow.component.Key in project linkki by linkki-framework.
the class UIButtonIntegrationTest method testCreateButtonShortcut_NoKeys.
@Test
void testCreateButtonShortcut_NoKeys() {
ButtonComponentDefinitionCreator buttonComponentDefinitionCreator = new UIButton.ButtonComponentDefinitionCreator();
Optional<Key> shortcutKey = buttonComponentDefinitionCreator.createShortcutKey(getAnnotation("doFoo"));
assertThat(shortcutKey.isEmpty(), is(true));
}
Aggregations