aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/themes/valo
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2015-03-13 10:52:35 +0200
committerVaadin Code Review <review@vaadin.com>2015-04-10 12:21:49 +0000
commit4217d7bbc8552e822367fac9d7d3cc9ee48821dd (patch)
treea037cd500937e4b55d0b42d92d18e8f6d5905927 /uitest/src/com/vaadin/tests/themes/valo
parent7afa802ba1260105493eda183cae58069c2b7a92 (diff)
downloadvaadin-framework-4217d7bbc8552e822367fac9d7d3cc9ee48821dd.tar.gz
vaadin-framework-4217d7bbc8552e822367fac9d7d3cc9ee48821dd.zip
Don't use !important for ColorPicker width in Valo (#17140).
Change-Id: I47feff9c78a39e30233f388b938c7e4e53b52051
Diffstat (limited to 'uitest/src/com/vaadin/tests/themes/valo')
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/ValoDefaultCaptionWidth.java29
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/ValoDefaultCaptionWidthTest.java56
2 files changed, 85 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/themes/valo/ValoDefaultCaptionWidth.java b/uitest/src/com/vaadin/tests/themes/valo/ValoDefaultCaptionWidth.java
new file mode 100644
index 0000000000..6ef585cc12
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/themes/valo/ValoDefaultCaptionWidth.java
@@ -0,0 +1,29 @@
+/*
+ * 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.themes.valo;
+
+import com.vaadin.annotations.Theme;
+import com.vaadin.tests.components.colorpicker.DefaultCaptionWidth;
+
+/**
+ * Test for color picker with default caption.
+ *
+ * @author Vaadin Ltd
+ */
+@Theme("valo")
+public class ValoDefaultCaptionWidth extends DefaultCaptionWidth {
+
+}
diff --git a/uitest/src/com/vaadin/tests/themes/valo/ValoDefaultCaptionWidthTest.java b/uitest/src/com/vaadin/tests/themes/valo/ValoDefaultCaptionWidthTest.java
new file mode 100644
index 0000000000..7651b641de
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/themes/valo/ValoDefaultCaptionWidthTest.java
@@ -0,0 +1,56 @@
+/*
+ * 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.themes.valo;
+
+import static org.hamcrest.Matchers.greaterThan;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.lessThan;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ColorPickerElement;
+import com.vaadin.tests.components.colorpicker.DefaultCaptionWidthTest;
+
+/**
+ * Test for default caption behavior in color picker using Valo theme.
+ *
+ * @author Vaadin Ltd
+ */
+public class ValoDefaultCaptionWidthTest extends DefaultCaptionWidthTest {
+
+ @Override
+ @Test
+ public void setDefaultCaption_sizeAndCaptionAreNotSet_pickerGetsStyle() {
+ super.setDefaultCaption_sizeAndCaptionAreNotSet_pickerGetsStyle();
+ int width = $(ColorPickerElement.class).first().getSize().getWidth();
+ // Make sure that implicit width is less than one that will be
+ // explicitly set by the test
+ assertThat("Width of color picker is overriden by "
+ + "default caption feature", width, is(lessThan(148)));
+ }
+
+ @Override
+ @Test
+ public void setDefaultCaption_explicitSizeIsSet_pickerNoCaptionStyle() {
+ super.setDefaultCaption_explicitSizeIsSet_pickerNoCaptionStyle();
+ int width = $(ColorPickerElement.class).first().getSize().getWidth();
+ // Width should be 150px but let's just check that it's not which is
+ // used when default caption is used and at least >= 150-1
+ assertThat("Width of color picker is overriden by "
+ + "default caption feature", width, is(greaterThan(149)));
+ }
+}