Search in sources :

Example 1 with Placeholderable

use of com.github.bordertech.wcomponents.Placeholderable in project wcomponents by BorderTech.

the class HtmlRenderUtilTest method testGetEffectivePlaceholder.

@Test
public void testGetEffectivePlaceholder() {
    Placeholderable field = new WTextField();
    String actual = HtmlRenderUtil.getEffectivePlaceholder(field);
    Assert.assertNull("Placeholder should not be set for an optional field with no explicit placeholder text", actual);
}
Also used : WTextField(com.github.bordertech.wcomponents.WTextField) Placeholderable(com.github.bordertech.wcomponents.Placeholderable) Test(org.junit.Test)

Example 2 with Placeholderable

use of com.github.bordertech.wcomponents.Placeholderable in project wcomponents by BorderTech.

the class HtmlRenderUtilTest method testGetEffectivePlaceholderWithExplicitValue.

@Test
public void testGetEffectivePlaceholderWithExplicitValue() {
    Placeholderable field = new WTextField();
    String expected = "my placeholder is boring";
    field.setPlaceholder(expected);
    String actual = HtmlRenderUtil.getEffectivePlaceholder(field);
    Assert.assertEquals(expected, actual);
}
Also used : WTextField(com.github.bordertech.wcomponents.WTextField) Placeholderable(com.github.bordertech.wcomponents.Placeholderable) Test(org.junit.Test)

Aggregations

Placeholderable (com.github.bordertech.wcomponents.Placeholderable)2 WTextField (com.github.bordertech.wcomponents.WTextField)2 Test (org.junit.Test)2