Search in sources :

Example 1 with SafeHtmlRenderer

use of com.google.gwt.text.shared.SafeHtmlRenderer in project kie-wb-common by kiegroup.

the class AbstractProxyPopupDropDownListBoxRenderTest method listBoxShouldHaveTheRightItems.

@Test
public void listBoxShouldHaveTheRightItems() {
    final SafeHtmlRenderer renderer = mock(SafeHtmlRenderer.class);
    listBoxDropDown.render(mock(Cell.Context.class), "", mock(SafeHtmlBuilder.class), renderer);
    verify(listBox).addItem("Fork", "1");
    verify(listBox).addItem("Spoon", "2");
    verify(listBox).addItem("Knife", "3");
    verify(listBox).addItem("Spork", "4");
    verify(listBox).addItem("Fork, Spoon and Knife", "\"1,2,3\"");
}
Also used : SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) SafeHtmlRenderer(com.google.gwt.text.shared.SafeHtmlRenderer) Test(org.junit.Test)

Example 2 with SafeHtmlRenderer

use of com.google.gwt.text.shared.SafeHtmlRenderer in project kie-wb-common by kiegroup.

the class AbstractProxyPopupDropDownListBoxRenderTest method noExistingPairForTheValue.

@Test
public void noExistingPairForTheValue() {
    doReturn(true).when(listBox).isMultipleSelect();
    final SafeHtmlRenderer renderer = mock(SafeHtmlRenderer.class);
    listBoxDropDown.render(mock(Cell.Context.class), "10", mock(SafeHtmlBuilder.class), renderer);
    verify(renderer).render("10");
}
Also used : SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) SafeHtmlRenderer(com.google.gwt.text.shared.SafeHtmlRenderer) Test(org.junit.Test)

Example 3 with SafeHtmlRenderer

use of com.google.gwt.text.shared.SafeHtmlRenderer in project kie-wb-common by kiegroup.

the class AbstractProxyPopupDropDownListBoxRenderTest method renderFork.

@Test
public void renderFork() {
    doReturn(true).when(listBox).isMultipleSelect();
    final SafeHtmlRenderer renderer = mock(SafeHtmlRenderer.class);
    listBoxDropDown.render(mock(Cell.Context.class), "1", mock(SafeHtmlBuilder.class), renderer);
    verify(renderer).render("Fork");
}
Also used : SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) SafeHtmlRenderer(com.google.gwt.text.shared.SafeHtmlRenderer) Test(org.junit.Test)

Example 4 with SafeHtmlRenderer

use of com.google.gwt.text.shared.SafeHtmlRenderer in project kie-wb-common by kiegroup.

the class AbstractProxyPopupDropDownListBoxRenderTest method appendIsCalled.

@Test
public void appendIsCalled() {
    final SafeHtmlBuilder sb = mock(SafeHtmlBuilder.class);
    final SafeHtmlRenderer renderer = mock(SafeHtmlRenderer.class);
    final SafeHtml safeHtml = mock(SafeHtml.class);
    doReturn(safeHtml).when(renderer).render(anyString());
    listBoxDropDown.render(mock(Cell.Context.class), "", sb, renderer);
    verify(sb).append(safeHtml);
}
Also used : SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) SafeHtmlRenderer(com.google.gwt.text.shared.SafeHtmlRenderer) Test(org.junit.Test)

Example 5 with SafeHtmlRenderer

use of com.google.gwt.text.shared.SafeHtmlRenderer in project kie-wb-common by kiegroup.

the class AbstractProxyPopupDropDownListBoxRenderTest method renderForkSpoonKnife.

@Test
public void renderForkSpoonKnife() {
    doReturn(true).when(listBox).isMultipleSelect();
    final SafeHtmlRenderer renderer = mock(SafeHtmlRenderer.class);
    listBoxDropDown.render(mock(Cell.Context.class), "\"1,2,3\"", mock(SafeHtmlBuilder.class), renderer);
    verify(renderer).render("Fork, Spoon and Knife");
}
Also used : SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) SafeHtmlRenderer(com.google.gwt.text.shared.SafeHtmlRenderer) Test(org.junit.Test)

Aggregations

SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)5 SafeHtmlRenderer (com.google.gwt.text.shared.SafeHtmlRenderer)5 Test (org.junit.Test)5 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)1