aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/test
diff options
context:
space:
mode:
authorTatu Lund <tatu@vaadin.com>2020-09-04 13:23:34 +0300
committerGitHub <noreply@github.com>2020-09-04 13:23:34 +0300
commit665f3355a2f6a759ca7ee088025a4546c3953b02 (patch)
treeb0166df139e67730dfc805b183251f033e9d60ac /server/src/test
parent10f7e15da976f2cd9ffd19674121cb1d403ef355 (diff)
downloadvaadin-framework-665f3355a2f6a759ca7ee088025a4546c3953b02.tar.gz
vaadin-framework-665f3355a2f6a759ca7ee088025a4546c3953b02.zip
Add convenience overloading for setColumn (#12093)8.12.0.alpha2
Fixes: https://github.com/vaadin/framework/issues/7773
Diffstat (limited to 'server/src/test')
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/grid/GridTest.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridTest.java
index 6f1a227a1c..5320959967 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridTest.java
@@ -571,6 +571,25 @@ public class GridTest {
}
@Test
+ public void setColumns_addColumns_v2_beangrid() {
+ Grid<Person> grid = new Grid<>(Person.class);
+
+ // Remove so we can add it back
+ grid.removeColumn("name");
+
+ List<String> columnIds = new ArrayList<>();
+ columnIds.add("born");
+ columnIds.add("name");
+
+ grid.setColumns(columnIds);
+
+ List<Column<Person, ?>> columns = grid.getColumns();
+ assertEquals(2, columns.size());
+ assertEquals("born", columns.get(0).getId());
+ assertEquals("name", columns.get(1).getId());
+ }
+
+ @Test
public void setColumnOrder_byColumn() {
grid.setColumnOrder(randomColumn, lengthColumn);