]> source.dussan.org Git - vaadin-framework.git/commitdiff
Button icon 'icon-align-top' style correction (#15140).
authorDenis Anisimov <denis@vaadin.com>
Tue, 20 Jan 2015 07:20:29 +0000 (09:20 +0200)
committerVaadin Code Review <review@vaadin.com>
Tue, 20 Jan 2015 08:50:54 +0000 (08:50 +0000)
Change-Id: I16bc415596431340e4e4d1944b3927dc3fd6cd96

uitest/src/com/vaadin/tests/themes/valo/AlignTopIconInButtonTest.java

index 287e25d4028120551827c57074703b0a3f2b9d1f..02ef8867214757e81251ed22e9a125f93064e830 100644 (file)
  */
 package com.vaadin.tests.themes.valo;
 
-import org.junit.Assert;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.lessThanOrEqualTo;
+
 import org.junit.Test;
 import org.openqa.selenium.By;
 import org.openqa.selenium.WebElement;
@@ -30,7 +33,7 @@ import com.vaadin.tests.tb3.MultiBrowserTest;
 public class AlignTopIconInButtonTest extends MultiBrowserTest {
 
     @Test
-    public void testIconPositioninButton() {
+    public void iconIsCenteredInsideButton() {
         openTestURL();
 
         WebElement wrapper = findElement(By.className("v-button-wrap"));
@@ -41,7 +44,6 @@ public class AlignTopIconInButtonTest extends MultiBrowserTest {
                 + wrapper.getSize().getWidth() - icon.getLocation().getX()
                 - icon.getSize().getWidth();
 
-        Assert.assertTrue("Icon element is not centered inside button.",
-                Math.abs(rightSpace - leftSpace) <= 1);
+        assertThat(Math.abs(rightSpace - leftSpace), is(lessThanOrEqualTo(2)));
     }
 }