summaryrefslogtreecommitdiffstats
path: root/server/tests
diff options
context:
space:
mode:
authorSauli Tähkäpää <sauli@vaadin.com>2015-08-28 13:36:01 +0300
committerSauli Tähkäpää <sauli@vaadin.com>2015-10-28 08:42:09 +0200
commitfb28652b033bc500c114c65d84f418b6249befa4 (patch)
tree7080fc7abd60654a7776a69245b94136f086fbd7 /server/tests
parent1ee652d48c5e9a5fb5ea4e550492935689ce53f9 (diff)
downloadvaadin-framework-fb28652b033bc500c114c65d84f418b6249befa4.tar.gz
vaadin-framework-fb28652b033bc500c114c65d84f418b6249befa4.zip
Support caption fetching for HTML and Widget headers. (#18528)
Change-Id: Idad2cbbb6b138258ff6428e7ecc3d922ef99c675
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/grid/GridColumns.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/server/tests/src/com/vaadin/tests/server/component/grid/GridColumns.java b/server/tests/src/com/vaadin/tests/server/component/grid/GridColumns.java
index da230e86c7..83e9f21756 100644
--- a/server/tests/src/com/vaadin/tests/server/component/grid/GridColumns.java
+++ b/server/tests/src/com/vaadin/tests/server/component/grid/GridColumns.java
@@ -18,6 +18,8 @@ package com.vaadin.tests.server.component.grid;
import static org.easymock.EasyMock.and;
import static org.easymock.EasyMock.capture;
import static org.easymock.EasyMock.isA;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
@@ -391,4 +393,22 @@ public class GridColumns {
assertFalse("Event should not be userOriginated",
event.isUserOriginated());
}
+
+ @Test
+ public void textHeaderCaptionIsReturned() {
+ Column firstColumn = grid.getColumns().get(0);
+
+ firstColumn.setHeaderCaption("text");
+
+ assertThat(firstColumn.getHeaderCaption(), is("text"));
+ }
+
+ @Test
+ public void defaultCaptionIsReturnedForHtml() {
+ Column firstColumn = grid.getColumns().get(0);
+
+ grid.getDefaultHeaderRow().getCell("column0").setHtml("<b>html</b>");
+
+ assertThat(firstColumn.getHeaderCaption(), is("Column0"));
+ }
}