use of org.xwiki.icon.IconSet in project xwiki-platform by xwiki.
the class DefaultIconManagerTest method renderHTMLWithFallBack.
@Test
public void renderHTMLWithFallBack() throws Exception {
IconSet iconSet = new IconSet("silk");
when(iconSetManager.getCurrentIconSet()).thenReturn(iconSet);
IconSet defaultIconSet = new IconSet("default");
when(iconSetManager.getDefaultIconSet()).thenReturn(defaultIconSet);
when(iconRenderer.renderHTML("test", defaultIconSet)).thenReturn("rendered icon");
// Test
String result = mocker.getComponentUnderTest().renderHTML("test");
assertEquals("rendered icon", result);
}
use of org.xwiki.icon.IconSet in project xwiki-platform by xwiki.
the class DefaultIconRendererTest method renderWithSSX.
@Test
public void renderWithSSX() throws Exception {
IconSet iconSet = new IconSet("default");
iconSet.setSsx("ssx");
iconSet.addIcon("test", new Icon("blabla"));
// Test
mocker.getComponentUnderTest().render("test", iconSet);
// Verify
verify(skinExtension).use("ssx");
verify(linkExtension, never()).use(any());
verify(jsExtension, never()).use(any());
}
use of org.xwiki.icon.IconSet in project xwiki-platform by xwiki.
the class DefaultIconRendererTest method renderHTMLWithSSX.
@Test
public void renderHTMLWithSSX() throws Exception {
IconSet iconSet = new IconSet("default");
iconSet.setSsx("ssx");
iconSet.addIcon("test", new Icon("blabla"));
// Test
mocker.getComponentUnderTest().renderHTML("test", iconSet);
// Verify
verify(skinExtension).use("ssx");
verify(linkExtension, never()).use(any());
verify(jsExtension, never()).use(any());
}
use of org.xwiki.icon.IconSet in project xwiki-platform by xwiki.
the class DefaultIconRendererTest method renderWithCSS.
@Test
public void renderWithCSS() throws Exception {
IconSet iconSet = new IconSet("default");
iconSet.setCss("css");
iconSet.addIcon("test", new Icon("blabla"));
when(velocityRenderer.render("css")).thenReturn("velocityParsedCSS");
// Test
mocker.getComponentUnderTest().render("test", iconSet);
// Verify
Map<String, Object> parameters = new HashMap<>();
parameters.put("rel", "stylesheet");
verify(linkExtension).use(eq("velocityParsedCSS"), eq(parameters));
verify(skinExtension, never()).use(any());
verify(jsExtension, never()).use(any());
}
use of org.xwiki.icon.IconSet in project xwiki-platform by xwiki.
the class DefaultIconRendererTest method render.
@Test
public void render() throws Exception {
IconSet iconSet = new IconSet("default");
iconSet.setRenderWiki("image:$icon.png");
iconSet.addIcon("test", new Icon("blabla"));
when(velocityRenderer.render("#set($icon = \"blabla\")\nimage:$icon.png")).thenReturn("image:blabla.png");
// Test
String result = mocker.getComponentUnderTest().render("test", iconSet);
// Verify
assertEquals("image:blabla.png", result);
verify(linkExtension, never()).use(any());
verify(skinExtension, never()).use(any());
verify(jsExtension, never()).use(any());
}
Aggregations