summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorTeppo Kurki <teppo.kurki@vaadin.com>2015-08-18 21:46:39 +0300
committerJohannes Dahlström <johannesd@vaadin.com>2015-08-21 07:16:31 +0000
commit5c56d140bebc5aaf23790c6abb081f5f2b2a5cf6 (patch)
tree7b0f06dfd8894406b6edc32549d99c489e349f37 /uitest
parentba7071612bb546a74e49fcd82d37ceab9bbe420a (diff)
downloadvaadin-framework-5c56d140bebc5aaf23790c6abb081f5f2b2a5cf6.tar.gz
vaadin-framework-5c56d140bebc5aaf23790c6abb081f5f2b2a5cf6.zip
Cut off Grid cell content when max column width is set (#18617)
Change-Id: I912377ffe366e6ac46280b374fa04caa59c3bcf2
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java12
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnMaxWidthTest.java37
2 files changed, 49 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java
index 23226fb6cf..479ece71ca 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java
@@ -1174,6 +1174,18 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> {
}
});
+
+ createClickAction("All columns expanding, Col 0 has max width of 30px",
+ "Columns", new Command<Grid, Boolean>() {
+
+ @Override
+ public void execute(Grid c, Boolean value, Object data) {
+ for (Column col : grid.getColumns()) {
+ col.setWidthUndefined();
+ }
+ grid.getColumns().get(0).setMaximumWidth(30);
+ }
+ }, null);
}
private static String getColumnProperty(int c) {
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnMaxWidthTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnMaxWidthTest.java
new file mode 100644
index 0000000000..dffa22fdc6
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnMaxWidthTest.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.grid.basicfeatures.server;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest;
+
+public class GridColumnMaxWidthTest extends GridBasicFeaturesTest {
+
+ @Test
+ public void testRemovingAllColumns() {
+ setDebug(true);
+ openTestURL();
+
+ selectMenuPath("Component", "Columns",
+ "All columns expanding, Col 0 has max width of 30px");
+
+ assertEquals("Column 0 did not obey max width of 30px.", "30px",
+ getGridElement().getCell(0, 0).getCssValue("width"));
+ }
+} \ No newline at end of file