]> source.dussan.org Git - vaadin-framework.git/commitdiff
Reverse asc and desc table sorting indicators for Valo. (#15123)
authorSauli Tähkäpää <sauli@vaadin.com>
Sat, 1 Nov 2014 12:04:39 +0000 (14:04 +0200)
committerVaadin Code Review <review@vaadin.com>
Mon, 3 Nov 2014 10:11:46 +0000 (10:11 +0000)
Change-Id: If649d7ab0b4257cfaa1488dfff88afa8ef122f67

WebContent/VAADIN/themes/valo/components/_table.scss
uitest/src/com/vaadin/tests/themes/valo/TableSortIndicator.java [new file with mode: 0644]
uitest/src/com/vaadin/tests/themes/valo/TableSortIndicatorTest.java [new file with mode: 0644]

index d8a673294d6b009f82a94477b24ce4236b99b008..a70532ccfd1b6da46be50097ca24a16fa7cd7bee 100644 (file)
@@ -612,7 +612,7 @@ $v-table-background-color: null !default;
  * @group table
  */
 @mixin valo-table-sort-asc-icon-style {
-  content: '\f0dd';
+  content: '\f0de';
   font-family: FontAwesome;
 }
 
@@ -623,7 +623,7 @@ $v-table-background-color: null !default;
  * @group table
  */
 @mixin valo-table-sort-desc-icon-style {
-  content: '\f0de';
+  content: '\f0dd';
   font-family: FontAwesome;
 }
 
diff --git a/uitest/src/com/vaadin/tests/themes/valo/TableSortIndicator.java b/uitest/src/com/vaadin/tests/themes/valo/TableSortIndicator.java
new file mode 100644 (file)
index 0000000..74e5fcd
--- /dev/null
@@ -0,0 +1,34 @@
+package com.vaadin.tests.themes.valo;
+
+import com.vaadin.annotations.*;
+import com.vaadin.server.*;
+import com.vaadin.tests.components.*;
+import com.vaadin.ui.*;
+
+@Theme("valo")
+public class TableSortIndicator extends AbstractTestUI {
+    @Override
+    protected void setup(VaadinRequest request) {
+        Table table = new Table();
+        table.addContainerProperty("Index", Integer.class, "");
+
+        for(int i=0;i<10;i++) {
+            table.addItem(new Object[] {i}, i);
+        }
+
+        table.setPageLength(0);
+
+        addComponent(table);
+    }
+
+    @Override
+    protected String getTestDescription() {
+        return "For Valo, sorting indicators should point up when sorted asc " +
+                "and down when sorted desc.";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 15123;
+    }
+}
diff --git a/uitest/src/com/vaadin/tests/themes/valo/TableSortIndicatorTest.java b/uitest/src/com/vaadin/tests/themes/valo/TableSortIndicatorTest.java
new file mode 100644 (file)
index 0000000..42f0b2a
--- /dev/null
@@ -0,0 +1,46 @@
+package com.vaadin.tests.themes.valo;
+
+import com.vaadin.testbench.By;
+import com.vaadin.tests.tb3.*;
+import org.junit.*;
+import org.openqa.selenium.*;
+
+import java.io.*;
+
+public class TableSortIndicatorTest extends MultiBrowserTest {
+
+    private void clickOnCellHeader() {
+        clickElementByClass("v-table-header-cell");
+    }
+
+    @Test
+    public void ascendingIndicatorIsShown() throws IOException {
+        openTestURL();
+
+        clickOnCellHeader();
+
+        compareScreen("ascending");
+    }
+
+    @Test
+    public void descendingIndicatorIsShown() throws IOException {
+        openTestURL();
+
+        clickOnCellHeader();
+        clickOnSortIndicator();
+
+        compareScreen("descending");
+    }
+
+    private void clickOnSortIndicator() {
+        clickElementByClass("v-table-sort-indicator");
+    }
+
+    private void clickElementByClass(String className) {
+        findElementByClass(className).click();
+    }
+
+    private WebElement findElementByClass(String className) {
+        return driver.findElement(By.className(className));
+    }
+}
\ No newline at end of file